diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-17 11:33:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-17 11:41:35 +0200 |
commit | 96c2536411dea74dc8e60883bbd31201c18a4f17 (patch) | |
tree | e946ed8e8043e44928d34778295e14bb9662e7ff /CMakeLists.txt | |
parent | 3266cba9e0e9e3dec20bd25e836cf500967b143d (diff) |
cmake: don't regen version if none changed
Fixes caused re-link of executable
Diffstat (limited to 'CMakeLists.txt')
-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) |