How to make cmake build script for project that use ecpg code generation and qt moc compiler?
Also how to add code generation in cmake (which is easy in make)?
How to make cmake build script for project that use ecpg code generation and qt moc compiler?
Also how to add code generation in cmake (which is easy in make)?
This is how we added code generation for ecpg in cmake.
set( PGSQL_CMD "/usr/pgsql-9.3/bin/ecpg" )
set( PGSQL_ARG "input_file.pgc" )
add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/output_file.c
COMMAND ${PGSQL_CMD} ${PGSQL_ARG}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/input_file.pgc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )