diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-03-12 08:50:24 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-03-12 09:07:59 +0100 |
commit | 4ffc8c28bfa1d43c91e69b51951e5461d28f6e84 (patch) | |
tree | 96d140318846d7340209dad2d39fca00a6a249b1 /cmake/opentrack-version.cmake | |
parent | 239a9e4f1cf1ac64aca8a9909b35e0d910eef226 (diff) |
installer: prepend "DEBUG-" for debug builds
Diffstat (limited to 'cmake/opentrack-version.cmake')
-rw-r--r-- | cmake/opentrack-version.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmake/opentrack-version.cmake b/cmake/opentrack-version.cmake index 64072e1c..268a5531 100644 --- a/cmake/opentrack-version.cmake +++ b/cmake/opentrack-version.cmake @@ -6,7 +6,15 @@ if(GIT_FOUND) git_describe(OPENTRACK_TAG_EXACT --tag --exact) endif() -file(WRITE ${CMAKE_BINARY_DIR}/opentrack-version.h "#define OPENTRACK_VERSION \"${OPENTRACK_COMMIT}\"") +unset(_build_type) +string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) +if (NOT _build_type STREQUAL "DEBUG") + unset(_build_type) +else() + set(_build_type "${_build_type}-") +endif() + +file(WRITE ${CMAKE_BINARY_DIR}/opentrack-version.h "#define OPENTRACK_VERSION \"${_build_type}${OPENTRACK_COMMIT}\"") add_library(opentrack-version STATIC ${CMAKE_BINARY_DIR}/version.cc) opentrack_compat(opentrack-version) @@ -20,7 +28,7 @@ extern \"C\" OPENTRACK_EXPORT const char* opentrack_version; -const char* opentrack_version = \"${OPENTRACK_COMMIT}\"; +const char* opentrack_version = \"${_build_type}${OPENTRACK_COMMIT}\"; ") set(crapola-ver) |