-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackageDEB.cmake
46 lines (40 loc) · 1.77 KB
/
PackageDEB.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
# SET(CPACK_DEBIAN_FILE_NAME "DEB_DEFAULT")
IF(CMAKE_VERSION VERSION_LESS "3.16")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n${CPACK_PACKAGE_DESCRIPTION}")
STRING(REGEX REPLACE "\n" "\n " CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
# Replace blank lines with . control statement
STRING(REGEX REPLACE "\n +\n" "\n .\n" CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
ELSE()
# CMAKE auto-assembles CPACK_DEBIAN_PACKAGE_DESCRIPTION
ENDIF()
SET(CPACK_DEBIAN_PACKAGE_SECTION "science")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINTER ${CPACK_PACKAGE_CONTACT})
## Add target for creating the compressed changelog
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
COMMAND gzip -c -n -9 -f ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md > ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
COMMENT "Creating compressed changelog."
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md
)
add_custom_target(DEB_EXTRAS ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz)
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
DESTINATION "share/doc/morpheus/"
COMPONENT Morpheus_DEB_EXTRAS
)
INSTALL( FILES LICENSE.md
RENAME copyright
DESTINATION "share/doc/morpheus/"
COMPONENT Morpheus_DEB_EXTRAS
)
## Set Package Dependencies
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "gnuplot (>= 4.4)")
IF (MORPHEUS_GUI)
MESSAGE(STATUS "Adding GUI dependencies" )
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libqt5sql5-sqlite")
ENDIF()
IF (MORPHEUS_GRAPHVIZ STREQUAL "Library")
MESSAGE(STATUS "Adding GraphVIZ dependencies" )
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, graphviz")
ENDIF()