@@ -38,6 +38,7 @@ set(OPTIMIZER_STRATEGY "NelderMead" CACHE STRING "Optimizer strategy (LBFGS, Nel
3838set (DISCRETIZATION_RANGE "200" CACHE STRING "How finely to divide the continuous range" )
3939option (MODEL_GENE_EXPRESSION_LOGS "Perform calculations using log values rather than linear values" ON )
4040option (USE_MAX_PROBABILITY "Evaluate probability as maximum value rather than cumulative" OFF )
41+ option (INCLUDE_GIT_IN_VERSION_INFO "Write information about the last GIT commit into version info" OFF )
4142
4243if (MODEL_GENE_EXPRESSION_LOGS)
4344 add_definitions (-DMODEL_GENE_EXPRESSION_LOGS)
@@ -50,16 +51,20 @@ endif()
5051add_definitions (-DOPTIMIZER_STRATEGY=${OPTIMIZER_STRATEGY} )
5152add_definitions (-DDISCRETIZATION_RANGE=${DISCRETIZATION_RANGE} )
5253
53- # Define the two required variables before including
54- # the source code for watching a git repository.
55- set (PRE_CONFIGURE_FILE "git_version.cpp.in" )
56- set (POST_CONFIGURE_FILE "${CMAKE_CURRENT_BINARY_DIR} /git_version.cpp" )
57- include (git_watcher.cmake)
5854
59- # Create a library out of the compiled post-configure file.
60- add_library (git STATIC ${POST_CONFIGURE_FILE} )
61- target_include_directories (git PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
62- add_dependencies (git check_git)
55+ if (INCLUDE_GIT_IN_VERSION_INFO)
56+ # Define the two required variables before including
57+ # the source code for watching a git repository.
58+ set (PRE_CONFIGURE_FILE "git_version.cpp.in" )
59+ set (POST_CONFIGURE_FILE "${CMAKE_CURRENT_BINARY_DIR} /git_version.cpp" )
60+ include (git_watcher.cmake)
61+
62+ # Create a library out of the compiled post-configure file.
63+ add_definitions (-DINCLUDE_GIT_IN_VERSION_INFO)
64+ add_library (git STATIC ${POST_CONFIGURE_FILE} )
65+ target_include_directories (git PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
66+ add_dependencies (git check_git)
67+ endif ()
6368
6469# add the executable
6570add_executable (cagee main.cpp)
@@ -77,8 +82,10 @@ add_subdirectory(src)
7782
7883link_libraries (Eigen3::Eigen)
7984
80- target_link_libraries (cagee PRIVATE git)
81- target_link_libraries (tests PRIVATE git)
85+ if (INCLUDE_GIT_IN_VERSION_INFO)
86+ target_link_libraries (cagee PRIVATE git)
87+ target_link_libraries (tests PRIVATE git)
88+ endif ()
8289
8390find_package (ZLIB)
8491target_link_libraries (cagee PRIVATE ZLIB::ZLIB)
0 commit comments