diff options
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 20 | ||||
-rw-r--r-- | source/creator/creator.c | 1 |
3 files changed, 27 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 504ef5d8dd8..92c670f572c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF) -# OPTION(WITH_BUILDINFO "Include extra build details" ON) +OPTION(WITH_BUILDINFO "Include extra build details" ON) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) @@ -517,15 +517,15 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") -# TODO - buildinfo -# IF(UNIX) -# IF(WITH_BUILDINFO) -# EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE) -# EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME) -# EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV) -# SET(BUILD_TYPE ${CMAKE_BUILD_TYPE}) -# ENDIF(WITH_BUILDINFO) -# ENDIF(UNIX) +# buildinfo +IF(UNIX) + IF(WITH_BUILDINFO) + EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE) + EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME) + EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV) + # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake + ENDIF(WITH_BUILDINFO) +ENDIF(UNIX) #----------------------------------------------------------------------------- # Common. diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 410e0808580..51a52ee6861 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -78,14 +78,26 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") INCLUDE_DIRECTORIES(${BINRELOC_INC}) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") -MESSAGE(STATUS "Configuring blender") +# Setup the exe sources and buildinfo +SET(EXESRC creator.c) IF(WIN32) - ADD_EXECUTABLE(blender ${EXETYPE} creator.c ../icons/winblender.rc) -ELSE(WIN32) - ADD_EXECUTABLE(blender ${EXETYPE} creator.c) + SET(EXESRC ${EXESRC} ../icons/winblender.rc) ENDIF(WIN32) +IF(WITH_BUILDINFO) + ADD_DEFINITIONS(-DBUILD_DATE="${BUILD_DATE}") + ADD_DEFINITIONS(-DBUILD_TIME="${BUILD_TIME}") + ADD_DEFINITIONS(-DBUILD_REV="${BUILD_REV}") + ADD_DEFINITIONS(-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}") + ADD_DEFINITIONS(-DBUILD_TYPE="${CMAKE_BUILD_TYPE}") + + SET(EXESRC ${EXESRC} buildinfo.c) +ENDIF(WITH_BUILDINFO) + +MESSAGE(STATUS "Configuring blender") + +ADD_EXECUTABLE(blender ${EXETYPE} ${EXESRC}) # Post build steps for bundling/packaging. diff --git a/source/creator/creator.c b/source/creator/creator.c index 579825b805a..6f64628b467 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -101,6 +101,7 @@ #ifdef BUILD_DATE extern char * build_date; extern char * build_time; +extern char * build_rev; extern char * build_platform; extern char * build_type; #endif |