Merge pull request #2217 from ctapmex/colorer-schemes
[far2l.git] / packaging / CMakeLists.txt
blob2e6a31aea2e981a6f7414191190a1aaa1fb05fdf
1 string(TOLOWER ${PROJECT_NAME} CPACK_PACKAGE_NAME)
2 IF (NOT ${USEWX})
3     SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-nowx")
4 ENDIF()
5 set(CPACK_PACKAGE_VENDOR "elfmz")
6 set(CPACK_PACKAGE_CONTACT "https://github.com/elfmz")
7 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Multi-platform fork of FAR v2")
8 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
9 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
10 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
11 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
12 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
13 SET(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
14 set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${VERSION})
16 LIST(APPEND PACKAGE_DEPENDENCIES libc6)
17 LIST(APPEND PACKAGE_DEPENDENCIES libglib2.0-0 libstdc++6)
18 LIST(APPEND PACKAGE_DEPENDENCIES "libgcc-s1 | libgcc | libgcc1")
19 LIST(APPEND PACKAGE_DEPENDENCIES libminizip1 libpcre3)
20 # from main project
21 IF (${USEWX})
22     find_package(wxWidgets REQUIRED core base)
23     IF (${wxWidgets_VERSION_STRING} EQUAL "3.2.1")
24         LIST(APPEND PACKAGE_DEPENDENCIES "libwxgtk3.2-1, libwxbase3.2-1")
25     ELSE()
26         LIST(APPEND PACKAGE_DEPENDENCIES libwxgtk3.0-gtk3-0v5)
27     ENDIF()
28 ENDIF()
29 if(OPENSSL_FOUND)
30     LIST(APPEND PACKAGE_DEPENDENCIES "libssl1.1 | libssl3")
31 endif(OPENSSL_FOUND)
32 if(LIBSSH_FOUND)
33     LIST(APPEND PACKAGE_DEPENDENCIES libssh-4)
34 endif(LIBSSH_FOUND)
35 if(LIBSMBCLIENT_FOUND)
36     LIST(APPEND PACKAGE_DEPENDENCIES libsmbclient)
37 endif(LIBSMBCLIENT_FOUND)
38 if(LIBNFS_FOUND)
39     LIST(APPEND PACKAGE_DEPENDENCIES "libnfs11 | libnfs12 | libnfs13")
40 endif(LIBNFS_FOUND)
41 if(LIBNEON_FOUND)
42     LIST(APPEND PACKAGE_DEPENDENCIES libneon27)
43 endif(LIBNEON_FOUND)
44 if(PCRE_FOUND)
45     LIST(APPEND PACKAGE_DEPENDENCIES libpcre2-8-0)
46 endif(PCRE_FOUND)
47 if(LibArchive_FOUND)
48     LIST(APPEND PACKAGE_DEPENDENCIES libarchive13)
49 endif(LibArchive_FOUND)
51 string(REPLACE ";" ", " PACKAGE_DEPENDENCIES "${PACKAGE_DEPENDENCIES}")
53 FIND_PROGRAM(DPKG_CMD dpkg)
54 IF(DPKG_CMD)
55     LIST(APPEND CPACK_GENERATOR DEB)
56 ELSE(DPKG_CMD)
57     MESSAGE( STATUS "dpkg binary not found, not building debian package" )
58 ENDIF(DPKG_CMD)
60 # CPack components:
61 # -- app, base, system (main project);
62 # -- desktop (far2l subproject).
64 SET(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
65 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
66     set(CPACK_COMPONENTS_ALL app)
67     set(CPACK_GENERATOR DragNDrop)
68     set(CPACK_DMG_VOLUME_NAME ${CPACK_PACKAGE_NAME}-${VERSION})
69     set(CPACK_DMG_DS_STORE_SETUP_SCRIPT ${CMAKE_BINARY_DIR}/packaging/osx/Setup.scpt)
70     set(CPACK_DMG_BACKGROUND_IMAGE ${PROJECT_SOURCE_DIR}/packaging/osx/Background.png)
71     set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/far2l/DE/Far.icns)
73     configure_file(${PROJECT_SOURCE_DIR}/packaging/osx/Setup.scpt.in ${CMAKE_BINARY_DIR}/packaging/osx/Setup.scpt)
74 else ()
75     set(CPACK_COMPONENTS_ALL base desktop system)
76     SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
78     LIST(FIND CPACK_GENERATOR DEB DEB_GENERATOR_PRESENCE)
79     IF(DEB_GENERATOR_PRESENCE GREATER -1) # linux (deb)
80         set(CPACK_DEB_COMPONENT_INSTALL ON)
81         # add DEB-package controls to build process
82         ADD_SUBDIRECTORY(debian)
83         set(CPACK_DEBIAN_BASE_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
84         set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
85         SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_VENDOR})
86         SET(CPACK_DEBIAN_PACKAGE_SECTION contrib/utils)
87         SET(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
88         SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_DEPENDENCIES})
89     ENDIF(DEB_GENERATOR_PRESENCE GREATER -1)
91     LIST(APPEND CPACK_GENERATOR TGZ)
92     set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
93     set(CPACK_ARCHIVE_BASE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
94 endif ()
96 include(CPack)