diff options
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 992ea9ac..b9925b4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ file(WRITE ${CMAKE_BINARY_DIR}/opentrack-version.h "#define OPENTRACK_VERSION \" ## start crapola -file(WRITE ${CMAKE_BINARY_DIR}/version.cc " +set(version-string " #include \"opentrack-compat/export.hpp\" #ifdef __cplusplus @@ -33,6 +33,15 @@ const char* opentrack_version; const char* opentrack_version = \"${OPENTRACK_COMMIT}\"; ") +set(crapola-ver) +if(EXISTS ${CMAKE_BINARY_DIR}/version.cc) + file(READ ${CMAKE_BINARY_DIR}/version.cc crapola-ver) +endif() + +if(NOT (crapola-ver STREQUAL version-string)) + file(WRITE ${CMAKE_BINARY_DIR}/version.cc "${version-string}") +endif() + ## end crapola SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) |