Cleanup generation of AboutThisBuild.txt and fix wrong path assumtions for the splash screen (closes issue #591) (branch_3.0)

This commit is contained in:
Philip Rinn
2011-03-27 17:13:41 +02:00
parent 5b159e8d5f
commit 12e4991c6b
7 changed files with 67 additions and 33 deletions

View File

@@ -4,11 +4,18 @@
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")
execute_process(COMMAND ${HG_CMD} parents --template={latesttag}.{latesttagdistance} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_VERSION)
execute_process(COMMAND ${HG_CMD} parents --template={node|short} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_CHANGESET)
execute_process(COMMAND ${HG_CMD} parents --template={latesttagdistance} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE HG_TAGDISTANCE)
# build version.h from template
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/rtgui/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/rtgui/version.h)
add_custom_target (AboutFile ALL
COMMAND for /F \"tokens=*\" %%i in \('hg -R \"${CMAKE_CURRENT_SOURCE_DIR}\" branch'\) do echo Branch: %%i >${OUT_FILE}
COMMAND hg -R \"${CMAKE_CURRENT_SOURCE_DIR}\" parents --template=\"Version: {latesttag}.{latesttagdistance}\\nChangset: {node|short}\\n\" >>${OUT_FILE}
COMMAND echo Version: ${HG_VERSION} >>${OUT_FILE}
COMMAND echo Changset: ${HG_CHANGESET} >>${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 Bit depth: ${PROC_BIT_DEPTH}\) >>${OUT_FILE}
@@ -16,9 +23,8 @@ add_custom_target (AboutFile ALL
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}
COMMAND (if ${WITH_MYFILE_MMAP}==ON \(echo MMAP support: Yes\) else \(echo MMAP support: No\)) >>${OUT_FILE}
COMMAND (if ${WITH_RAWZOR}==ON \(echo Rawzor support: Yes\) else \(echo Rawzor support: No\)) >>${OUT_FILE}
COMMAND hg -R \"${CMAKE_CURRENT_SOURCE_DIR}\" parents --template=\"// This file is automatically generated by the Makefile \; DO NOT EDIT!\\n// You can \(should\) also tell mercurial to ignore it.\\n\\n\#ifndef _VERSION_\\n\#define _VERSION_\\n\\n\#define VERSION \\"{latesttag}.{latesttagdistance}\\"\\n\#define TAGDISTANCE {latesttagdistance}\\n\\n\#endif\\n\" >${VERSION_FILE}
COMMAND \(echo OpenMP support: ${OPTION_OMP}\) >>${OUT_FILE}
COMMAND \(echo MMAP support: ${WITH_MYFILE_MMAP}\) >>${OUT_FILE}
COMMAND \(echo Rawzor support: ${WITH_RAWZOR}\) >>${OUT_FILE}
COMMENT "Creating the about file"
)