build: Make sure version string is always being set

This commit is contained in:
WerWolv 2022-08-07 23:50:49 +02:00
parent e16216b39e
commit 519a9edb60
1 changed files with 5 additions and 4 deletions

View File

@ -36,15 +36,16 @@ macro(addVersionDefines)
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} -DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} -DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH} ")
set(IMHEX_VERSION_STRING ${IMHEX_VERSION})
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(IMHEX_VERSION_STRING ${IMHEX_VERSION})
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING})
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-Debug)
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING}-Debug)
add_compile_definitions(DEBUG)
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-RelWithDebInfo)
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING}-RelWithDebInfo)
elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set(IMHEX_VERSION_STRING ${IMHEX_VERSION}-MinSizeRel)
set(IMHEX_VERSION_STRING ${IMHEX_VERSION_STRING}-MinSizeRel)
endif ()
add_compile_definitions(IMHEX_VERSION="${IMHEX_VERSION_STRING}")