File: CMakeLists.txt

package info (click to toggle)
cryfs 0.9.10-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,832 kB
  • sloc: cpp: 80,948; python: 7,881; ansic: 4,097; sh: 1,895; makefile: 1,707
file content (53 lines) | stat: -rw-r--r-- 3,651 bytes parent folder | download
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
# We only allow generating distribution packages if:
# - it is a release build (to ensure all generated debian packages are fine to be distributed)
# - tests are not built (because otherwise CPack would start installing googletest with the package as well)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILDTYPE)
if(BUILDTYPE MATCHES RELEASE AND NOT BUILD_TESTING)
    if("${CMAKE_VERSION}" VERSION_LESS "3.3")
        # Earlier cmake versions generate .deb packages for which the package manager says they're bad quality
        # and asks the user whether they really want to install it. Cmake 3.3 fixes this.
        message(WARNING "Distribution package generation is only supported for CMake version >= 3.3. You're using ${CMAKE_VERSION}. You will be able to build and install CryFS, but you won't be able to generate .deb packages.")
    else("${CMAKE_VERSION}" VERSION_LESS "3.3")
        # Fix debfiles permissions. Unfortunately, git doesn't store file permissions.
        # When installing the .deb package and these files have the wrong permissions, the package manager complains.
        execute_process(COMMAND /bin/bash -c "chmod 0755 ${CMAKE_CURRENT_SOURCE_DIR}/debfiles/*")

        set(CPACK_GENERATOR TGZ DEB RPM)
        set(CPACK_PACKAGE_NAME "cryfs")
        get_git_version(GITVERSION_VERSION_STRING)
        set(CPACK_PACKAGE_VERSION "${GITVERSION_VERSION_STRING}")
        set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Encrypt your files and store them in the cloud.")
        set(CPACK_PACKAGE_DESCRIPTION "CryFS encrypts your files, so you can safely store them anywhere. It works well together with cloud services like Dropbox, iCloud, OneDrive and others.")
        set(CPACK_PACKAGE_CONTACT "Sebastian Messmer <messmer@cryfs.org>")
        set(CPACK_PACKAGE_VENDOR "Sebastian Messmer")
        set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE")
        set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
        if(WIN32 AND NOT UNIX)
            # There is a bug in NSI that does not handle full unix paths properly. Make
            # sure there is at least one set of four (4) backlasshes.
            #set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
            #set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\cryfs.exe")
            #set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} CryFS")
            #set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.cryfs.org")
            #set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.cryfs.org")
            #set(CPACK_NSIS_CONTACT "messmer@cryfs.org")
            #set(CPACK_NSIS_MODIFY_PATH ON)
        else(WIN32 AND NOT UNIX)
            set(CPACK_STRIP_FILES ON)
            set(CPACK_SOURCE_STRIP_FILES ON)
        endif(WIN32 AND NOT UNIX)
        set(CPACK_PACKAGE_EXECUTABLES "cryfs" "CryFS")
        set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
        set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
        # Needs gnupg2, lsb-release for postinst script
        set(CPACK_DEBIAN_PACKAGE_DEPENDS "fuse, gnupg2, lsb-release")

        set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.cryfs.org")
        set(CPACK_RPM_PACKAGE_LICENSE "LGPLv3")
        set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
        set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/bin;/usr/share/man;/usr/share/man/man1")
        set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postrm")

        include(CPack)
    endif("${CMAKE_VERSION}" VERSION_LESS "3.3")
endif(BUILDTYPE MATCHES RELEASE AND NOT BUILD_TESTING)