Using {node|short} in AboutThisBuild.txt, fixing a bug about processor label containing space (had to remove " " ), adding a CMake parameter to force the processor label : PROC_FORCED_LABEL

This commit is contained in:
natureh
2011-02-09 00:40:35 +01:00
parent ea2a260be1
commit 52f97eb139
6 changed files with 23 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ add_custom_target (AboutFile ALL
COMMAND rm -f ${OUT_FILE} COMMAND rm -f ${OUT_FILE}
COMMAND rm -f ${VERSION_FILE} COMMAND rm -f ${VERSION_FILE}
COMMAND for i in \$\( hg branch \)\; do echo Branch: $i >${OUT_FILE}\; done COMMAND for i in \$\( hg branch \)\; do echo Branch: $i >${OUT_FILE}\; done
COMMAND hg parents --template=\"Version: {latesttag}_{latesttagdistance}\\nChangset: {node}\\n\" >>${OUT_FILE} COMMAND hg parents --template=\"Version: {latesttag}.{latesttagdistance}\\nChangset: {node|short}\\n\" >>${OUT_FILE}
COMMAND for i in \$\( gcc -dumpversion \) \;do echo Compiler: GCC $i >>${OUT_FILE} \; done COMMAND for i in \$\( gcc -dumpversion \) \;do echo Compiler: GCC $i >>${OUT_FILE} \; done
COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE} COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE}
COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE} COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE}

View File

@@ -12,7 +12,7 @@ add_custom_target (AboutFile ALL
COMMAND rm -f ${OUT_FILE} COMMAND rm -f ${OUT_FILE}
COMMAND rm -f ${VERSION_FILE} COMMAND rm -f ${VERSION_FILE}
COMMAND for i in \$\( hg branch \)\; do echo Branch: $i >${OUT_FILE}\; done COMMAND for i in \$\( hg branch \)\; do echo Branch: $i >${OUT_FILE}\; done
COMMAND hg parents --template=\"Version: {latesttag}_{latesttagdistance}\\nChangset: {node}\\n\" >>${OUT_FILE} COMMAND hg parents --template=\"Version: {latesttag}.{latesttagdistance}\\nChangset: {node|short}\\n\" >>${OUT_FILE}
COMMAND for i in \$\( gcc -dumpversion \) \;do echo Compiler: GCC $i >>${OUT_FILE} \; done COMMAND for i in \$\( gcc -dumpversion \) \;do echo Compiler: GCC $i >>${OUT_FILE} \; done
COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE} COMMAND echo Processor: ${PROC_LABEL} >>${OUT_FILE}
COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE} COMMAND echo Bit depth: ${PROC_BIT_DEPTH} >>${OUT_FILE}

View File

@@ -8,7 +8,7 @@ set (VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rtgui/version.h")
add_custom_target (AboutFile ALL add_custom_target (AboutFile ALL
COMMAND for /F \"tokens=*\" %%i in \('hg branch'\) do echo Branch: %%i >${OUT_FILE} COMMAND for /F \"tokens=*\" %%i in \('hg branch'\) do echo Branch: %%i >${OUT_FILE}
COMMAND hg parents --template=\"Version: {latesttag}_{latesttagdistance}\\nChangset: {node}\\n\" >>${OUT_FILE} COMMAND hg parents --template=\"Version: {latesttag}.{latesttagdistance}\\nChangset: {node|short}\\n\" >>${OUT_FILE}
COMMAND for /F \"tokens=*\" %%i in \('gcc -dumpversion'\) do echo Compiler: GCC%%i >>${OUT_FILE} COMMAND for /F \"tokens=*\" %%i in \('gcc -dumpversion'\) do echo Compiler: GCC%%i >>${OUT_FILE}
COMMAND \(echo Processor: ${PROC_LABEL}\) >>${OUT_FILE} COMMAND \(echo Processor: ${PROC_LABEL}\) >>${OUT_FILE}
COMMAND \(echo Bit depth: ${PROC_BIT_DEPTH}\) >>${OUT_FILE} COMMAND \(echo Bit depth: ${PROC_BIT_DEPTH}\) >>${OUT_FILE}

View File

@@ -24,6 +24,11 @@ if (PROC_TARGET_NUMBER GREATER 0)
set (PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS}) set (PROC_FLAGS ${PROC_TARGET_${PROC_TARGET_NUMBER}_FLAGS})
endif (PROC_TARGET_NUMBER GREATER 0) endif (PROC_TARGET_NUMBER GREATER 0)
# if it exists, the PROC_FORCED_LABEL value is loaded in PROC_LABEL to override the one of ProcessorTargets
if (DEFINED PROC_FORCED_LABEL)
set (PROC_LABEL ${PROC_FORCED_LABEL})
endif (DEFINED PROC_FORCED_LABEL)
# adding the proc flags to the build flags # adding the proc flags to the build flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROC_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PROC_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROC_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PROC_FLAGS}")

View File

@@ -1,33 +1,33 @@
# We have to create a label variable if we want to display it in AboutThisBuild.txt... # We have to create a label variable if we want to display it in AboutThisBuild.txt...
# This first choice should be used for official releases # This first choice should be used for official releases
set(PROC_TARGET_1_LABEL "generic x86" CACHE STRING "Processor-1 label - should be used for official Windows release") set(PROC_TARGET_1_LABEL generic x86 CACHE STRING "Processor-1 label - should be used for official Windows release")
set(PROC_TARGET_1_FLAGS "-mtune=generic" CACHE STRING "Processor-1 flags") set(PROC_TARGET_1_FLAGS "-mtune=generic" CACHE STRING "Processor-1 flags")
# This second choice should be used for your own build only # This second choice should be used for your own build only
set(PROC_TARGET_2_LABEL "native" CACHE STRING "Processor-2 label - use it for your own build") set(PROC_TARGET_2_LABEL native CACHE STRING "Processor-2 label - use it for your own build")
set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags") set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags")
# The later choices is intended to be used if you want to provide specific builds, but it should match your own processor # The later choices is intended to be used if you want to provide specific builds, but it should match your own processor
# You can cross compile but you have to know what you're doing, this mechanism has not been designed for that # You can cross compile but you have to know what you're doing, this mechanism has not been designed for that
set(PROC_TARGET_3_LABEL "pentium/no-sse" CACHE STRING "Processor-3 label - use it to provide a pentium/no sse optimized build, if you have this processor") set(PROC_TARGET_3_LABEL pentium/no-sse CACHE STRING "Processor-3 label - use it to provide a pentium/no sse optimized build, if you have this processor")
set(PROC_TARGET_3_FLAGS "-march=pentium -mfpmath=387" CACHE STRING "Processor-3 flags") set(PROC_TARGET_3_FLAGS "-march=pentium -mfpmath=387" CACHE STRING "Processor-3 flags")
set(PROC_TARGET_4_LABEL "pentium4" CACHE STRING "Processor-4 label - use it to provide a pentium4 optimized build, if you have this processor") set(PROC_TARGET_4_LABEL pentium4 CACHE STRING "Processor-4 label - use it to provide a pentium4 optimized build, if you have this processor")
set(PROC_TARGET_4_FLAGS "-march=pentium4 -mfpmath=sse" CACHE STRING "Processor-4 flags") set(PROC_TARGET_4_FLAGS "-march=pentium4 -mfpmath=sse" CACHE STRING "Processor-4 flags")
set(PROC_TARGET_5_LABEL "core2" CACHE STRING "Processor-5 label - use it to provide a core2 optimized build, if you have this processor") set(PROC_TARGET_5_LABEL core2 CACHE STRING "Processor-5 label - use it to provide a core2 optimized build, if you have this processor")
set(PROC_TARGET_5_FLAGS "-march=core2 -mfpmath=sse" CACHE STRING "Processor-5 flags") set(PROC_TARGET_5_FLAGS "-march=core2 -mfpmath=sse" CACHE STRING "Processor-5 flags")
set(PROC_TARGET_6_LABEL "corei7" CACHE STRING "Processor-6 label - use it to provide a corei7 optimized build, if you have this processor") set(PROC_TARGET_6_LABEL corei7 CACHE STRING "Processor-6 label - use it to provide a corei7 optimized build, if you have this processor")
set(PROC_TARGET_6_FLAGS "-march=corei7 -mfpmath=sse" CACHE STRING "Processor-6 flags") set(PROC_TARGET_6_FLAGS "-march=corei7 -mfpmath=sse" CACHE STRING "Processor-6 flags")
set(PROC_TARGET_7_LABEL "athlon-4" CACHE STRING "Processor-7 label - use it to provide a athlon-4 optimized build, if you have this processor") set(PROC_TARGET_7_LABEL athlon-4 CACHE STRING "Processor-7 label - use it to provide a athlon-4 optimized build, if you have this processor")
set(PROC_TARGET_7_FLAGS "-march=athlon-4 -mfpmath=sse" CACHE STRING "Processor-7 flags") set(PROC_TARGET_7_FLAGS "-march=athlon-4 -mfpmath=sse" CACHE STRING "Processor-7 flags")
set(PROC_TARGET_8_LABEL "athlon64" CACHE STRING "Processor-8 label - use it to provide a athlon64 optimized build, if you have this processor") set(PROC_TARGET_8_LABEL athlon64 CACHE STRING "Processor-8 label - use it to provide a athlon64 optimized build, if you have this processor")
set(PROC_TARGET_8_FLAGS "-march=pentium2 -mtune=athlon64 -mfpmath=sse" CACHE STRING "Processor-8 flags") set(PROC_TARGET_8_FLAGS "-march=pentium2 -mtune=athlon64 -mfpmath=sse" CACHE STRING "Processor-8 flags")
#set(PROC_TARGET__LABEL "" CACHE STRING "Processor- label") #set(PROC_TARGET__LABEL procLabel CACHE STRING "Processor- label")
#set(PROC_TARGET__FLAGS "" CACHE STRING "Processor- flags") #set(PROC_TARGET__FLAGS "procFlags" CACHE STRING "Processor- flags")

View File

@@ -18,9 +18,11 @@ set(OPTION_OMP ON CACHE BOOL "Use OpenMP to speedup the preview and batch proces
# set WITH_MYFILE_MMAP to OFF if you experience crash with thumbnail creation (it should be slower, but more reliable) # set WITH_MYFILE_MMAP to OFF if you experience crash with thumbnail creation (it should be slower, but more reliable)
set(WITH_MYFILE_MMAP ON CACHE BOOL "Use the MMAP mechanism to speedup thumbnail creations") set(WITH_MYFILE_MMAP ON CACHE BOOL "Use the MMAP mechanism to speedup thumbnail creations")
# This line will let you chose the target number, and the associated processor
set (PROC_TARGET_NUMBER 2 CACHE STRING "Target Processor") set (PROC_TARGET_NUMBER 2 CACHE STRING "Target Processor")
# If you want to manually specify the target processor name, uncomment the line right under, and set its value
#set (PROC_LABEL 'Core i7' X2 CACHE STRING "Target Processor label") # If you want to force the target processor name, uncomment the next line, and replace labelWithoutQuotes by its value
#set (PROC_FORCED_LABEL labelWithoutQuotes CACHE STRING "Target Processor label")
set(CMAKE_CXX_FLAGS "-mwin32 -mthreads" CACHE STRING "Compiler options for C++ source files") set(CMAKE_CXX_FLAGS "-mwin32 -mthreads" CACHE STRING "Compiler options for C++ source files")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g2" CACHE STRING "Compiler options for C++ source files and Debug target") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g2" CACHE STRING "Compiler options for C++ source files and Debug target")
@@ -28,7 +30,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "-mwindows -DNDEBUG -O2" CACHE STRING "Compiler opti
set(CMAKE_CXX_FLAGS_MINSIZEREL "-mwindows -DNDEBUG -Os" CACHE STRING "Compiler options for C++ source files and MinSizeRel target") set(CMAKE_CXX_FLAGS_MINSIZEREL "-mwindows -DNDEBUG -Os" CACHE STRING "Compiler options for C++ source files and MinSizeRel target")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Compiler options for C++ source files and RelWithDebInfo target") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Compiler options for C++ source files and RelWithDebInfo target")
# Uncomment the next line and set the right value to override the default value # Uncomment the next line and set the right value to override the default value (special compiling flags for RTEngine)
#set(RTENGINE_CXX_FLAGS "-funroll-loops" CACHE STRING "Special compilation flags for RTEngine") #set(RTENGINE_CXX_FLAGS "-funroll-loops" CACHE STRING "Special compilation flags for RTEngine")
set(CMAKE_C_FLAGS "-mwin32 -mthreads" CACHE STRING "Compiler options for C source files") set(CMAKE_C_FLAGS "-mwin32 -mthreads" CACHE STRING "Compiler options for C source files")