@@ -39,48 +39,6 @@ if(${enable_cbmc_tests})
3939 enable_testing ()
4040endif ()
4141
42- # based on https://cmake.org/pipermail/cmake/2010-July/038015.html
43- find_package (Git)
44- if (GIT_FOUND)
45- file (WRITE ${CMAKE_BINARY_DIR} /version .cmake
46- "
47- file(STRINGS \$ {CBMC_SOURCE_DIR}/config.inc
48- config_inc_v REGEX \" CBMC_VERSION *= *[0-9\. ]+\" )
49- string(REGEX REPLACE \" ^CBMC_VERSION *= *\" \"\" CBMC_RELEASE \$ {config_inc_v})
50- execute_process(
51- COMMAND \" ${GIT_EXECUTABLE} \" \" describe\" \" --tags\" \" --always\" \" --dirty\"
52- OUTPUT_VARIABLE GIT_INFO
53- OUTPUT_STRIP_TRAILING_WHITESPACE
54- )
55- configure_file(\$ {CUR}/version.h.in version.h)
56- "
57- )
58- else ()
59- file (WRITE ${CMAKE_BINARY_DIR} /version .cmake
60- "
61- file(STRINGS \$ {CBMC_SOURCE_DIR}/config.inc
62- config_inc_v REGEX \" CBMC_VERSION *= *[0-9\. ]+\" )
63- string(REGEX REPLACE \" ^CBMC_VERSION *= *\" \"\" CBMC_RELEASE \$ {config_inc_v})
64- set(GIT_INFO \" n/a\" )
65- configure_file(\$ {CUR}/version.h.in version.h)
66- "
67- )
68- endif ()
69-
70- macro (git_revision target )
71- file (WRITE ${CMAKE_CURRENT_BINARY_DIR} /version .h.in
72- "\# define CBMC_VERSION \" @CBMC_RELEASE@ (@GIT_INFO@)\"\n " )
73- add_custom_target (
74- ${target} -version .h
75- COMMAND ${CMAKE_COMMAND}
76- -D CBMC_SOURCE_DIR=${CBMC_SOURCE_DIR}
77- -D CUR=${CMAKE_CURRENT_BINARY_DIR}
78- -P ${CMAKE_BINARY_DIR} /version .cmake
79- )
80- add_dependencies (${target} ${target} -version .h)
81- endmacro ()
82- include_directories (${CMAKE_CURRENT_BINARY_DIR} )
83-
8442add_subdirectory (src)
8543add_subdirectory (regression)
8644add_subdirectory (unit)
0 commit comments