Browse Source

moved cpack to custom script

master
Arwed Mett 3 years ago
parent
commit
584ac4a7cb
Signed by: Pfeifenjoy GPG Key ID: 86943827297DA9FC
  1. 31
      CMakeLists.txt
  2. 27
      cmake/pack.cmake

31
CMakeLists.txt

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
project(logging.h LANGUAGES C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(Git)
include(git)
#Targets
add_library(Logging src/logging.c)
@ -43,31 +43,4 @@ install(
lib/cmake/Logging
)
#CPack
set(CPACK_BUNDLE_NAME "logging.h")
set(CPACK_PACKAGE_CONTACT "arwed.mett@googlemail.com")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://gitea.metthub.de/Pfeifenjoy/argparse")
set(CPACK_PACKAGE_CHECKSUM "SHA512")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt")
if(GIT_CURRENT_VERSION MATCHES "[0-9]+.[0-9]+.[0-9]+")
set(CPACK_PACKAGE_FILE_NAME
"logging.h-${CMAKE_SYSTEM_NAME}-${GIT_CURRENT_VERSION}")
else()
set(CPACK_PACKAGE_FILE_NAME
"logging.h-${CMAKE_SYSTEM_NAME}-${GIT_BRANCH}-${GIT_COMMIT_HASH}")
endif()
message(STATUS "Package name: ${CPACK_PACKAGE_FILE_NAME}")
if(APPLE)
set(CPACK_GENERATOR "TGZ;ZIP;productbuild")
elseif(UNIX)
set(CPACK_GENERATOR "TGZ;ZIP;RPM;DEB")
elseif(WIN32)
set(CPACK_GENERATOR "ZIP;NSIS;NSIS64")
else()
set(CPACK_GENERATOR "TGZ;ZIP")
endif()
include(CPack)
include(pack)

27
cmake/pack.cmake

@ -0,0 +1,27 @@
set(CPACK_BUNDLE_NAME "logging.h")
set(CPACK_PACKAGE_CONTACT "arwed.mett@googlemail.com")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://gitea.metthub.de/Pfeifenjoy/argparse")
set(CPACK_PACKAGE_CHECKSUM "SHA512")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
if(GIT_CURRENT_VERSION MATCHES "[0-9]+.[0-9]+.[0-9]+")
set(CPACK_PACKAGE_FILE_NAME
"logging.h-${CMAKE_SYSTEM_NAME}-${GIT_CURRENT_VERSION}")
else()
set(CPACK_PACKAGE_FILE_NAME
"logging.h-${CMAKE_SYSTEM_NAME}-${GIT_BRANCH}-${GIT_COMMIT_HASH}")
endif()
message(STATUS "Package name: ${CPACK_PACKAGE_FILE_NAME}")
if(APPLE)
set(CPACK_GENERATOR "TGZ;ZIP;productbuild")
elseif(UNIX)
set(CPACK_GENERATOR "TGZ;ZIP;RPM;DEB")
elseif(WIN32)
set(CPACK_GENERATOR "ZIP;NSIS;NSIS64")
else()
set(CPACK_GENERATOR "TGZ;ZIP")
endif()
include(CPack)
Loading…
Cancel
Save