From: TimePath Date: Thu, 3 Aug 2017 12:05:12 +0000 (+1000) Subject: Add CPack targets package and package_source X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5c6f3c50c6b6303cb0e311b68adf32680106d905;p=xonotic%2Fnetradiant.git Add CPack targets package and package_source --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 168e7726..397737a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 index 00000000..be530ec1 --- /dev/null +++ b/cmake/scripts/package.cmake @@ -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)