sc3dev/cmake/packaging.cmake

40 lines
1.2 KiB
CMake

### Packaging ###
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VENDOR "K. Isom")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME
${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_ARCH}${CMAKE_HOST_SYSTEM_PROCESSOR})
# Debian settings
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_VENDOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_PACKAGE_DEPENDS)
set(CPACK_DEBIAN_PACKAGE_SECTION devel)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
if (LINUX)
set(CPACK_GENERATOR "DEB;RPM;STGZ;TGZ")
elseif (APPLE)
set(CPACK_GENERATOR "productbuild")
elseif (MSVC OR MSYS OR MINGW)
set(CPACK_GENERATOR "NSIS;ZIP")
else ()
set(CPACK_GENERATOR "ZIP")
endif ()
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES
/.git
/.*build.*)
include (CPack)
add_custom_target(package_docs DEPENDS ${PROJECT_NAME}_docs package package_source)