readd revision info to the cpack generated package
authorkoda
Sat, 09 Mar 2013 00:38:53 +0100
changeset 8699 89c339dcc2a4
parent 8698 6714499ecdeb
child 8700 7e84ea0d9cef
readd revision info to the cpack generated package
cmake_modules/CPackConfig.cmake
--- a/cmake_modules/CPackConfig.cmake	Sat Mar 09 00:26:25 2013 +0100
+++ b/cmake_modules/CPackConfig.cmake	Sat Mar 09 00:38:53 2013 +0100
@@ -1,13 +1,20 @@
+
+# revision information in cpack-generated names
+if(CMAKE_BUILD_TYPE MATCHES DEBUG)
+    set(full_suffix "${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION}")
+else()
+    set(full_suffix "${HEDGEWARS_VERSION}")
+endif()
 
 # CPack variables
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a free turn-based strategy")
 set(CPACK_PACKAGE_VENDOR "Hedgewars Project")
-set(CPACK_PACKAGE_FILE_NAME "hedgewars-${HEDGEWARS_VERSION}")
-set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${HEDGEWARS_VERSION}")
+set(CPACK_PACKAGE_FILE_NAME "hedgewars-${full_suffix}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${full_suffix}")
 set(CPACK_SOURCE_GENERATOR "TBZ2")
 set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "hedgewars")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${HEDGEWARS_VERSION}")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${full_suffix}")
 
 if(WIN32 AND NOT UNIX)
     set(CPACK_NSIS_DISPLAY_NAME "Hedgewars")