diff -r 30cb5e836736 -r 0abada2a9802 CMakeLists.txt --- a/CMakeLists.txt Sat Feb 01 17:20:10 2020 +0200 +++ b/CMakeLists.txt Sun Feb 02 00:30:48 2020 +0200 @@ -140,6 +140,7 @@ ${LDFORGE_QM_RC_FILE} ${QM_FILES} ${LDFORGE_FORMS_HEADERS} + ${CMAKE_BINARY_DIR}/configuration.cpp ) set_source_files_properties(${LDFORGE_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE) @@ -150,6 +151,18 @@ add_dependencies(ldforge resources) cotire(ldforge) +add_custom_target (config_collection ALL + COMMAND python3 + "${CMAKE_SOURCE_DIR}/tools/configcollector.py" + --header ${CMAKE_BINARY_DIR}/configuration.h + --source ${CMAKE_BINARY_DIR}/configuration.cpp + --sourcedir ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/configurationoptions.txt + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +add_dependencies(ldforge config_collection) +set_source_files_properties (${CMAKE_BINARY_DIR}/configuration.cpp PROPERTIES GENERATED TRUE) +set_property(SOURCE configuration.cpp PROPERTY SKIP_AUTOGEN ON) + # Collect the current hg revision into hginfo.h add_custom_target(revision_check ALL COMMAND python3 "${CMAKE_SOURCE_DIR}/tools/updaterevision.py" --cwd "$(CMAKE_SOURCE_DIR)" hginfo.h