CMAKE_BUILD_TYPE now properly handled and information printed in AboutThisBuild.txt, thanks to greatbull69

This commit is contained in:
Hombre
2011-02-14 02:10:29 +01:00
parent 854e1bebda
commit 2d705ef811
4 changed files with 10 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
# this will generate a target that will never exist, so it will (should) be executed on each build
#WARNING: Actually, only Gcc is supported
string (TOUPPER ${BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
# wee look for the hg command in this paths by order of preference
find_file(HG_CMD hg PATHS "/opt/local/bin" "/usr/local/bin" "/usr/bin")
@@ -27,6 +27,7 @@ add_custom_target (AboutFile ALL
COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE}
COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE}
COMMAND echo Gtkmm: V${GTKMM_VERSION} >>${OUT_FILE}
COMMAND echo Build type: ${CMAKE_BUILD_TYPE} >>${OUT_FILE}
COMMAND echo Build flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} >>${OUT_FILE}
COMMAND echo Link flags: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} >>${OUT_FILE}
COMMAND if [ \"${OPTION_OMP}\" = \"ON\" ] \; then echo OpenMP support: Yes >>${OUT_FILE} \;else echo OpenMP support: No >>${OUT_FILE} \;fi

View File

@@ -1,10 +1,9 @@
# this will generate a target that will never exist, so it will (should) be executed on each build
#WARNING: Actually, only Gcc is supported
string (TOUPPER ${BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
# wee look for the hg command in this paths by order of preference
find_file(HG_CMD hg PATHS "/opt/local/bin" "/usr/local/bin" "/usr/bin")
find_file(HG_CMD hg)
if (HG_CMD STREQUAL HG_CMD-NOTFOUND)
@@ -27,6 +26,7 @@ add_custom_target (AboutFile ALL
COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE}
COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE}
COMMAND echo Gtkmm: V${GTKMM_VERSION} >>${OUT_FILE}
COMMAND echo Build type: ${CMAKE_BUILD_TYPE} >>${OUT_FILE}
COMMAND echo Build flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} >>${OUT_FILE}
COMMAND echo Link flags: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} >>${OUT_FILE}
COMMAND if [ \"${OPTION_OMP}\" = \"ON\" ] \; then echo OpenMP support: Yes >>${OUT_FILE} \;else echo OpenMP support: No >>${OUT_FILE} \;fi

View File

@@ -1,7 +1,7 @@
# this will generate a target that will never exist, so it will (should) be executed on each build
#WARNING: Actually, only Gcc is supported
string (TOUPPER ${BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
set (OUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/AboutThisBuild.txt")
set (VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rtgui/version.h")
@@ -13,6 +13,7 @@ add_custom_target (AboutFile ALL
COMMAND \(echo Processor: ${PROC_LABEL}\) >>${OUT_FILE}
COMMAND \(echo Bit depth: ${PROC_BIT_DEPTH}\) >>${OUT_FILE}
COMMAND \(echo Gtkmm: V${GTKMM_VERSION}\) >>${OUT_FILE}
COMMAND \(echo Build type: ${CMAKE_BUILD_TYPE}\) >>${OUT_FILE}
COMMAND \(echo Build flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} \) >>${OUT_FILE}
COMMAND \(echo Link flags: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}} \) >>${OUT_FILE}
COMMAND (if ${OPTION_OMP}==ON \(echo OpenMP support: Yes\) else \(echo OpenMP support: No\)) >>${OUT_FILE}

View File

@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 2.6)
# the default target is 'Debug'
set (CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel.")
if (CMAKE_BUILD_TYPE STREQUAL "")
set (CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
# By default, we don't use specific processor target, so PROC_TARGET_NUMBER is set to 0. If can specify other values to select specific
# processor targets, which list can be found in ProcessorTargets.cmake.
@@ -139,7 +142,6 @@ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
#generating AboutThisBuild.txt
set (BUILD_TYPE CMAKE_BUILD_TYPE)
if (WIN32)
include (About-Windows.cmake)
elseif (APPLE)