Complete revision to how RawTherapee's version is handled in CMake and in other files, #3628

This commit is contained in:
Morgan Hardwood
2017-01-25 00:18:52 +01:00
parent 9fbbb052ee
commit e5c00f0a9d
20 changed files with 217 additions and 193 deletions

View File

@@ -19,43 +19,23 @@ else (WIN32)
endif (WIN32)
if (WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(BUILD_BIT_DEPTH 32)
# 32 bits builds has to be installable on 64 bits system, to support WinXP/64.
set(ARCHITECTURE_ALLOWED "x86 x64 ia64")
# installing in 32 bits mode even on 64 bits OS and architecture
set(INSTALL_MODE "")
# set part of the output archive name
set(SYSTEM_NAME "WinXP")
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BUILD_BIT_DEPTH 64)
# Restricting the 64 bits builds to 64 bits systems only
set(ARCHITECTURE_ALLOWED "x64 ia64")
# installing in 64 bits mode for all 64 bits processors, even for itanium architecture
set(INSTALL_MODE "x64 ia64")
# set part of the output archive name
set(SYSTEM_NAME "WinVista")
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
# If we find ReleaseInfo.cmake we use the info from there and don't need Git to be installed
find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAULT_PATH)
if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
# we look for the git command in this paths by order of preference
find_file(GIT_CMD git.exe HINTS ENV Path PATH_SUFFIXES ../)
# Fail if Git is not installed
if (GIT_CMD STREQUAL GIT_CMD-NOTFOUND)
message(FATAL_ERROR "git command not found!")
else ()
message(STATUS "git command found: ${GIT_CMD}")
endif ()
execute_process(COMMAND ${GIT_CMD} describe --tags --always OUTPUT_VARIABLE GIT_VERSION_WHOLE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
string(REGEX REPLACE "-.*" "" GIT_VERSION ${GIT_VERSION_WHOLE})
string(REGEX REPLACE ".*-(.*)-g.*" "\\1" GIT_TAGDISTANCE ${GIT_VERSION_WHOLE})
else (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
include("${PROJECT_SOURCE_DIR}/ReleaseInfo.cmake")
endif (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(BUILD_BIT_DEPTH 32)
# 32 bits builds has to be installable on 64 bits system, to support WinXP/64.
set(ARCHITECTURE_ALLOWED "x86 x64 ia64")
# installing in 32 bits mode even on 64 bits OS and architecture
set(INSTALL_MODE "")
# set part of the output archive name
set(SYSTEM_NAME "WinXP")
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BUILD_BIT_DEPTH 64)
# Restricting the 64 bits builds to 64 bits systems only
set(ARCHITECTURE_ALLOWED "x64 ia64")
# installing in 64 bits mode for all 64 bits processors, even for itanium architecture
set(INSTALL_MODE "x64 ia64")
# set part of the output archive name
set(SYSTEM_NAME "WinVista")
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/../tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss")
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss" DESTINATION ${BINDIR})