forked from konoha-project/konoha3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpack.cmake
54 lines (54 loc) · 2.46 KB
/
cpack.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
if(CPACK_GENERATOR)
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_STRING})
set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
set(CPACK_PACKAGE_VENDOR ${PACKAGE_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Statically-typed scripting language")
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
if(NOT RELEASE_NUMBER)
set(RELEASE_NUMBER "0")
endif(NOT RELEASE_NUMBER)
if(CPACK_GENERATOR STREQUAL "PackageMaker") # macosx (dmg)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${RELEASE_NUMBER}")
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/README
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/LICENSE
${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/README
${CMAKE_CURRENT_BINARY_DIR}/README.txt)
set(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
elseif(CPACK_GENERATOR STREQUAL "DEB") # linux (deb)
find_program(DPKG NAMES dpkg)
if(DPKG)
execute_process(COMMAND ${DPKG} --print-architecture
OUTPUT_VARIABLE PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
else(DPKG)
set(PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(PROCESSOR "amd64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
set(PROCESSOR "i386")
endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
endif(DPKG)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${RELEASE_NUMBER}_${PROCESSOR}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"libc6 (>= 2.11), libpcre3, libcurl3")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER
"Konoha Developers <admin@konohascript.org>")
elseif(CPACK_GENERATOR STREQUAL "RPM") # linux (rpm)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${RELEASE_NUMBER}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_RPM_PACKAGE_LICENSE "Simplified BSD")
set(CPACK_RPM_PACKAGE_GROUP "Development/Languages")
set(CPACK_RPM_PACKAGE_URL "http://konohascript.org")
endif(CPACK_GENERATOR STREQUAL "PackageMaker")
include(CPack)
endif(CPACK_GENERATOR)