AW: [odb-users] --odb-epilogue option

Christian Sell christian at gsvitec.com
Tue Dec 16 08:06:28 EST 2014


Hello Per,

I have looked at it, and wasn't able to get it to run. Also, I don’t think
it's related to the issue I was having here, as it deals with discovering
the ODB tools, not invoking them

-Chris

-----Ursprüngliche Nachricht-----
Von: Per Edin [mailto:info at peredin.com] 
Gesendet: Dienstag, 16. Dezember 2014 14:04
An: Christian Sell
Cc: ODB Users Mailing List
Betreff: Re: [odb-users] --odb-epilogue option

Hi Christian!

Have you looked at https://github.com/BtbN/OdbCmake?

/Per
> On 16 Dec 2014, at 13:58, Christian Sell <christian at gsvitec.com> wrote:
> 
> Never mind. It was a matter of passing the quotes to the compiler, 
> which can
> (only) be ensured by using the VERBATIM option on the CMake 
> "add_custom_command" command, like so:
> 
> foreach(_file ${ODB_INFILES})
>   string(REPLACE ".h" "-odb.cpp" gencppfile ${_file})
>   string(REPLACE ".h" "-odb.h" genhppfile ${_file})
>   string(REPLACE ".h" "_pragmas.h" pragmafile ${_file})
>   add_custom_command(
>     OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${gencppfile}
>     COMMAND odb --std c++11 --database sqlite --cxx-suffix .cpp 
> --hxx-suffix .h --generate-query --generate-schema --odb-epilogue 
> "#include \"${pragmafile}\"" ${_file}
>     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
>     DEPENDS ${_file}
>     COMMENT "\nrunning odb on ${_file}"
>     VERBATIM
>     )
>   list(APPEND ODB_GENFILES ${gencppfile} ${genhppfile})
> endforeach()
> 
> -----Ursprüngliche Nachricht-----
> Von: Boris Kolpackov [mailto:boris at codesynthesis.com]
> Gesendet: Dienstag, 16. Dezember 2014 13:42
> An: Christian Sell
> Cc: odb-users at codesynthesis.com
> Betreff: Re: [odb-users] --odb-epilogue option
> 
> Hi Christian,
> 
> Christian Sell <christian at gsvitec.com> writes:
> 
>> odb --std c++11 --database sqlite --cxx-suffix .cpp --hxx-suffix .h 
>> --generate-query --generate-schema --odb-epilogue "#include 
>> \"${pragmafile}\"" ${_file}
> 
> Can you add the -v option to the above command line and then show the 
> g++ command line that the ODB compiler prints (starts after the line 
> saying "Compiling ${_file}").
> 
> Boris
> 
> 





More information about the odb-users mailing list