Skip to content
Snippets Groups Projects
Commit 3721c4dc authored by Robert K's avatar Robert K
Browse files

make codegen work with cmake.

parent 4a020106
No related branches found
No related tags found
No related merge requests found
......@@ -14,21 +14,19 @@ function(add_code_generate_targets)
#Add targets and executables
add_executable( ${_target}_codegenerator ${compilesources} )
set_property(TARGET ${_target}_codegenerator APPEND PROPERTY COMPILE_DEFINITIONS "NDEBUG;BASEFUNCTIONSET_CODEGEN_GENERATE;${compiledefs}")
dune_target_link_libraries( ${_target}_codegenerator "${DUNE_LIBS}" )
dune_target_enable_all_packages( ${_target}_codegenerator )
add_executable( ${_target}_optimized ${compilesources} )
set_property(TARGET ${_target}_optimized APPEND PROPERTY COMPILE_DEFINITIONS "USE_BASEFUNCTIONSET_CODEGEN;${compiledefs}")
dune_target_link_libraries( ${_target}_optimized "${DUNE_LIBS}" )
dune_target_enable_all_packages( ${_target}_optimized )
# include current dir because autogenerated code will be placed there
target_include_directories( ${_target}_optimized PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
add_custom_target( ${_target}_generate
${CMAKE_COMMAND} -D RUN_CODEGEN_PROGRAM=${CMAKE_CURRENT_BINARY_DIR}/${_target}_codegenerator -D RUN_CODEGEN_PARAMFILE="" -P ${CMAKE_SOURCE_DIR}/cmake/scripts/RunGenerate.cmake )
add_custom_target( ${_target}_codegen )
#Add depenencies
add_dependencies( ${_target}_generate ${_target}_codegenerator )
# add_dependencies( ${_target}_compilecode ${_target}_generate )
add_dependencies( ${_target}_codegen ${_target}_optimized )
endif()
endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment