]> Creatis software - creaTools.git/commitdiff
Feuture: Version.txt Description of the compilation type
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 24 Apr 2013 13:11:48 +0000 (15:11 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Wed, 24 Apr 2013 13:11:48 +0000 (15:11 +0200)
CMakeLists.txt
install/CMakeLists.txt

index d2647d4a77c69913d08111772060a00303a6fd98..070978b8b9eb4dab753c9d73a2acf1fc8cafc622 100644 (file)
@@ -88,6 +88,35 @@ MARK_AS_ADVANCED(
 #==================================
 
 
+MACRO (TODAY RESULT)
+    IF (WIN32)
+        EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
+        string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
+    ELSEIF(UNIX)
+        EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
+        string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
+    ELSE (WIN32)
+        MESSAGE(SEND_ERROR "date not implemented")
+        SET(${RESULT} 000000)
+    ENDIF (WIN32)
+ENDMACRO (TODAY)
+
+
+TODAY(CREATOOLS_COMPILATION_DATE)
+
+
+##         Project: @CMAKE_PROJECT_NAME@
+##         Version: @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_BUILD_VERSION@
+##        Platform: @CREATOOLS_PLATFORM@
+##      Build Type: @CREATOOLS_BUILDTYPE@
+##Compilation date: @CREATOOLS_COMPILATION_DATE@
+ CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/Version.txt.in
+    ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/Version.txt
+    @ONLY IMMEDIATE
+    )
+
+
 #==================================
 # Subdirs
 #ADD_SUBDIRECTORY(appli)
index b8ac0f90c18d20704ced635028bdc015f0591cc6..48d56456d559202fbcc59d67b222614151d842a8 100644 (file)
@@ -126,6 +126,8 @@ IF(WIN32 AND NOT UNIX)
         WriteRegExpandStr \\\${Install_ReadEnvStr_RegKey} 'PATH' $0
                
                AddToPath_doneEED:
+               CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Version.txt.lnk' '${CREATOOLS_DIRBIN}\\\\Version.txt' 
+
                SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 'STR:Environment' /TIMEOUT=5000 
 
                CreateShortCut  '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\creaTools_HomePage.lnk' '${CREATOOLS_DIRBIN}\\\\start.bat'  'www.creatis.insa-lyon.fr/site/creatools'
@@ -164,6 +166,7 @@ IF(WIN32 AND NOT UNIX)
                !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
                Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\CreaTools_HomePage.lnk'
                Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\ creaTools.lnk'
+               Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Version.txt.lnk'
                
 #              Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\creaNewProject.lnk'
 #              Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Developer_Tools\\\\bbStudio.lnk'
@@ -219,6 +222,8 @@ IF (WIN32)
 #INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_THIRDPARTY_DLLS}\\\\bin/                         DESTINATION "${CREATOOLS_DESTINATION_PATH}/bin" )
 #INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_THIRDPARTY_LIBRARIES}\\\\Library/        DESTINATION ${CREATOOLS_DESTINATION_PATH} )
 
+INSTALL(FILES ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/Version.txt DESTINATION . )
+
 INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/bin/                                                   DESTINATION bin  )
 INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/data/                                                  DESTINATION bin/data  )
 INSTALL(DIRECTORY ${CREATOOLS_SOURCE_PATH}\\\\${CREA_BASE}/                    DESTINATION ${CREATOOLS_DESTINATION_PATH}  )