Cleaned up CMake logic thanks to Hombre, #3628

This commit is contained in:
Morgan Hardwood 2017-01-28 02:29:22 +01:00
parent e5c00f0a9d
commit 77d5f8779b
6 changed files with 28 additions and 25 deletions

View File

@ -331,7 +331,7 @@ if (OUT_OF_SOURCE_BUILD)
endforeach(f)
endif ()
## BEGIN: Generating AboutThisBuild.txt
## BEGIN: Create AboutThisBuild.txt and other version-dependent files.
# set the bit number information of the platform
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(PROC_BIT_DEPTH 32 bits)
@ -382,9 +382,9 @@ endif (WIN32)
list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/AboutThisBuild.cmake")
add_custom_target(AboutFile ALL
add_custom_target(UpdateInfo ALL
COMMAND ${ABOUT_COMMAND_WITH_ARGS}
COMMENT "Creating the about file")
COMMENT "Creating AboutThisBuild.txt and other version-dependent files")
## END: Generating AboutThisBuild.txt

View File

@ -84,6 +84,28 @@ 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 (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)
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/../tools/win/InnoSetup/WindowsInnoSetup.iss.in" "${CMAKE_CURRENT_BINARY_DIR}/WindowsInnoSetup.iss")
endif (WIN32)
# build version.h from template
configure_file ("${PROJECT_SOURCE_DIR}/rtgui/version.h.in" "${CMAKE_BINARY_DIR}/rtgui/version.h")
# build AboutThisBuild.txt from template

View File

@ -19,25 +19,6 @@ 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)
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})
endif (WIN32)

View File

@ -29,7 +29,7 @@ set (RTENGINESOURCEFILES colortemp.cc curves.cc flatcurves.cc diagonalcurves.cc
include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
add_library (rtengine ${RTENGINESOURCEFILES})
add_dependencies (rtengine AboutFile)
add_dependencies (rtengine UpdateInfo)
#It may be nice to store library version too
IF (BUILD_SHARED_LIBS)

View File

@ -1,5 +1,5 @@
add_library (rtexif rtexif.cc stdattribs.cc nikonattribs.cc canonattribs.cc pentaxattribs.cc fujiattribs.cc sonyminoltaattribs.cc olympusattribs.cc kodakattribs.cc)
add_dependencies (rtexif AboutFile)
add_dependencies (rtexif UpdateInfo)
IF (WIN32)
set_target_properties (rtexif PROPERTIES COMPILE_FLAGS " -ffast-math -fexpensive-optimizations")

View File

@ -62,7 +62,7 @@ endif (WIN32)
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
add_executable (rth ${EXTRA_SRC} ${BASESOURCEFILES})
add_dependencies (rth AboutFile)
add_dependencies (rth UpdateInfo)
set_target_properties (rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee)
#target_link_libraries (rth rtengine ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${TIFF_LIBRARIES} ${EXTRA_LIB} ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES}