diff --git a/CMakeLists.txt b/CMakeLists.txt index 86348775..1a168619 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,49 +7,6 @@ include(utils.cmake) require_gcc_version(4.8) add_subdirectory(vendor) -add_subdirectory(gitversion) add_subdirectory(src) add_subdirectory(test) - -# 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/*") - -INSTALL(TARGETS ${BII_src_main_TARGET} - DESTINATION bin - CONFIGURATIONS Release) - -SET(CPACK_GENERATOR TGZ DEB RPM) -SET(CPACK_PACKAGE_NAME "cryfs") -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 ") -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 "bin/cryfs") - SET(CPACK_SOURCE_STRIP_FILES "") -ENDIF(WIN32 AND NOT UNIX) -SET(CPACK_PACKAGE_EXECUTABLES "cryfs" "CryFS") -SET(CPACK_DEBIAN_PACKAGE_SECTION "utils") -SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "fuse") - -SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.cryfs.org") -SET(CPACK_RPM_PACKAGE_LICENSE "LGPLv3") -SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postrm") - -INCLUDE(CPack) - +add_subdirectory(cpack) diff --git a/README.md b/README.md index d192164e..209a9742 100644 --- a/README.md +++ b/README.md @@ -51,13 +51,19 @@ Requirements - GCC version >= 4.8 or Clang (TODO which minimal version?) - CMake version >= 3.3 - libcurl4 (including development headers) - - Boost libraries filesystem, system, chrono, program_options, thread in version >= 1.56 - - Crypto++ >= 5.6.3 (TODO Lower minimal version possible?) - - libFUSE >= 2.8.6 (including development headers) + - Boost libraries version >= 1.56 (including development headers) + - filesystem + - system + - chrono + - program_options + - thread + - Crypto++ version >= 5.6.3 (including development headers) (TODO Lower minimal version possible?) + - libFUSE version >= 2.8.6 (including development headers) + +You can use the following commands to install these requirements # Ubuntu - $ sudo apt-get install libfuse-dev - TODO Other install commands + $ sudo apt-get install libcurl4-openssl-dev libboost-filesystem-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libboost-thread-dev libcrypto++-dev libfuse-dev # Fedora TODO diff --git a/cpack/CMakeLists.txt b/cpack/CMakeLists.txt new file mode 100644 index 00000000..549f0d61 --- /dev/null +++ b/cpack/CMakeLists.txt @@ -0,0 +1,39 @@ +include (../vendor/gitversion/gitversion-1.8/cmake.cmake) + +# 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") +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 ") +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 "bin/cryfs") + set(CPACK_SOURCE_STRIP_FILES "") +endif(WIN32 AND NOT UNIX) +set(CPACK_PACKAGE_EXECUTABLES "cryfs" "CryFS") +set(CPACK_DEBIAN_PACKAGE_SECTION "utils") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "fuse") + +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.cryfs.org") +set(CPACK_RPM_PACKAGE_LICENSE "LGPLv3") +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postrm") + +include(CPack) \ No newline at end of file diff --git a/debfiles/postinst b/cpack/debfiles/postinst similarity index 100% rename from debfiles/postinst rename to cpack/debfiles/postinst diff --git a/debfiles/postrm b/cpack/debfiles/postrm similarity index 100% rename from debfiles/postrm rename to cpack/debfiles/postrm diff --git a/src/cryfs/CMakeLists.txt b/src/cryfs/CMakeLists.txt index 3ba0ad95..9775c6dc 100644 --- a/src/cryfs/CMakeLists.txt +++ b/src/cryfs/CMakeLists.txt @@ -59,3 +59,8 @@ add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_lib) target_enable_style_warnings(${PROJECT_NAME}) target_activate_cpp14(${PROJECT_NAME}) + +install(TARGETS cryfs + COMPONENT cryfs-cli + DESTINATION bin + CONFIGURATIONS Release) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3c7840f2..89a5bcdd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,3 @@ -include(CTest) - if (BUILD_TESTING) include_directories(../src) diff --git a/vendor/gitversion/CMakeLists.txt b/vendor/gitversion/CMakeLists.txt index 4c287120..505483cf 100644 --- a/vendor/gitversion/CMakeLists.txt +++ b/vendor/gitversion/CMakeLists.txt @@ -1 +1 @@ -include(gitversion-1.7/cmake.cmake) +include(gitversion-1.8/cmake.cmake) diff --git a/vendor/googletest/CMakeLists.txt b/vendor/googletest/CMakeLists.txt index 28fd07c9..1b7118b5 100644 --- a/vendor/googletest/CMakeLists.txt +++ b/vendor/googletest/CMakeLists.txt @@ -1,6 +1,10 @@ -add_subdirectory(gtest-1.7.0) +include(CTest) -project (googletest) -add_library(${PROJECT_NAME} dummy.cpp) -target_link_libraries(${PROJECT_NAME} gtest gmock gmock_main) -target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${gtest_INCLUDE_DIRS}/include SYSTEM ${gmock_INCLUDE_DIRS}/include) +if (BUILD_TESTING) + add_subdirectory(gtest-1.7.0) + + project (googletest) + add_library(${PROJECT_NAME} dummy.cpp) + target_link_libraries(${PROJECT_NAME} gtest gmock gmock_main) + target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${gtest_INCLUDE_DIRS}/include SYSTEM ${gmock_INCLUDE_DIRS}/include) +endif (BUILD_TESTING)