Add CPack targets package and package_source
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 3 Aug 2017 12:05:12 +0000 (22:05 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 3 Aug 2017 12:05:12 +0000 (22:05 +1000)
CMakeLists.txt
cmake/scripts/package.cmake [new file with mode: 0644]

index 168e772..397737a 100644 (file)
@@ -246,14 +246,14 @@ install(
         "${PROJECT_BINARY_DIR}/RADIANT_MAJOR"
         "${PROJECT_BINARY_DIR}/RADIANT_MINOR"
         "${PROJECT_BINARY_DIR}/RADIANT_PATCH"
-        DESTINATION ${CMAKE_INSTALL_PREFIX}
+        DESTINATION .
 )
 
 install(
         DIRECTORY
-        ${PROJECT_SOURCE_DIR}/setup/data/tools/
-        ${PROJECT_SOURCE_DIR}/docs
-        DESTINATION ${CMAKE_INSTALL_PREFIX}
+        setup/data/tools/
+        docs
+        DESTINATION .
 )
 
 set(GAME_FILES
@@ -283,6 +283,8 @@ set(GAME_FILES ${_tmp})
 install(
         DIRECTORY
         ${GAME_FILES}
-        DESTINATION ${CMAKE_INSTALL_PREFIX}
+        DESTINATION .
         OPTIONAL
 )
+
+include(cmake/scripts/package.cmake)
diff --git a/cmake/scripts/package.cmake b/cmake/scripts/package.cmake
new file mode 100644 (file)
index 0000000..be530ec
--- /dev/null
@@ -0,0 +1,16 @@
+set(CPACK_PACKAGE_NAME "NetRadiant")
+set(CPACK_PACKAGE_VERSION_MAJOR "${NetRadiant_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${NetRadiant_VERSION_MINOR}")
+set(CPACK_PACKAGE_VERSION_PATCH "${NetRadiant_VERSION_PATCH}")
+
+# binary: --target package
+set(CPACK_GENERATOR "ZIP")
+set(CPACK_STRIP_FILES 1)
+
+# source: --target package_source
+set(CPACK_SOURCE_GENERATOR "ZIP")
+set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/build/;/install/")
+
+# configure
+include(InstallRequiredSystemLibraries)
+include(CPack)