git repos / blockattack-game

commit b1a99ae7

Poul Sander · 2016-05-27 21:08
b1a99ae7d53a975e5e8542d411bdbeebdc13d385 patch · browse files
parent 62b3f619ff042d5b9bd982542288df764c73b3b5

Added CPack to the CMakeLists.txt file

Changed files

M CMakeLists.txt before
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cc2e37..ab41ea2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -3,12 +3,20 @@ project (blockattack)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${blockattack_SOURCE_DIR}/source/misc/cmake")
set(BIN_DIR ${blockattack_SOURCE_DIR}/Game)
+SET(CPACK_PACKAGE_VERSION "2.1.0-SNAPSHOT")
+SET(CPACK_PACKAGE_VERSION_MAJOR "2")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Block Attack - Rise of the Blocks ${CPACK_PACKAGE_VERSION}")
+SET(CPACK_PACKAGE_VENDOR "Poul Sander")
+INCLUDE(CPack)
+
# Define install paths
-set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE STRING "Install executable in this directory")
-set(INSTALL_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/blockattack" CACHE STRING "Install data to this directory")
-set(INSTALL_MAN_DIR "/usr/share/man/man6" CACHE STRING "Install the man page to this directory")
-set(INSTALL_APPLICATIONS_DIR "/usr/share/applications" CACHE STRING "Install the .desktop file to this directory")
-set(INSTALL_ICONS_DIR "/usr/share/icons/hicolor" CACHE STRING "Install the icon in a subfolder in this directory")
+set(INSTALL_BIN_DIR "bin" CACHE STRING "Install executable in this directory")
+set(INSTALL_DATA_DIR "share/blockattack" CACHE STRING "Install data to this directory")
+set(INSTALL_MAN_DIR "man/man6" CACHE STRING "Install the man page to this directory")
+set(INSTALL_APPLICATIONS_DIR "applications" CACHE STRING "Install the .desktop file to this directory")
+set(INSTALL_ICONS_DIR "icons/hicolor" CACHE STRING "Install the icon in a subfolder in this directory")
set(INSTALL_LOCALE_DIR "${INSTALL_DATA_DIR}/locale/" CACHE STRING "Install translation to this dir")
# This sets up the exe icon for windows under mingw.
@@ -29,8 +37,8 @@ endif()
if (NOT WIN32)
#The path to the data dir must be compiled into the binary
-add_definitions(-DSHAREDIR=\"${INSTALL_DATA_DIR}\")
-add_definitions(-DLOCALEDIR=\"${INSTALL_LOCALE_DIR}\")
+add_definitions(-DSHAREDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA_DIR}\")
+add_definitions(-DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_LOCALE_DIR}\")
endif()
#Compiler options
@@ -80,4 +88,4 @@ install(FILES source/misc/icons/blockattack128.xpm DESTINATION "${INSTALL_ICONS_
install(FILES source/misc/icons/blockattack256.xpm DESTINATION "${INSTALL_ICONS_DIR}/256x256/apps" RENAME blockattack.xpm )
install(FILES source/misc/icons/blockattack64.xpm DESTINATION "${INSTALL_ICONS_DIR}/64x64/apps" RENAME blockattack.xpm )
install(FILES source/misc/icons/blockattack32.xpm DESTINATION "${INSTALL_ICONS_DIR}/32x32/apps" RENAME blockattack.xpm )
-install(DIRECTORY source/misc/translation/locale/ DESTINATION "${INSTALL_LOCALE_DIR}")
\ No newline at end of file
+install(DIRECTORY source/misc/translation/locale/ DESTINATION "${INSTALL_LOCALE_DIR}")