CMakeLists.txt (encfs-1.9.4) | : | CMakeLists.txt (encfs-1.9.5) | ||
---|---|---|---|---|
set(CMAKE_LEGACY_CYGWIN_WIN32 0) | ||||
# 3.0.2 preferred, but we can often get by with 2.8. | # 3.0.2 preferred, but we can often get by with 2.8. | |||
cmake_minimum_required(VERSION 2.8) | cmake_minimum_required(VERSION 2.8) | |||
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 3. 0.2) | if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 3. 0.2) | |||
message(WARNING "You should use cmake 3.0.2 or newer for configuration to run correctly.") | message(WARNING "You should use cmake 3.0.2 or newer for configuration to run correctly.") | |||
endif() | endif() | |||
project(EncFS C CXX) | project(EncFS C CXX) | |||
set (ENCFS_MAJOR 1) | set (ENCFS_MAJOR 1) | |||
set (ENCFS_MINOR 9) | set (ENCFS_MINOR 9) | |||
set (ENCFS_PATCH 4) | set (ENCFS_PATCH 5) | |||
set (ENCFS_VERSION "${ENCFS_MAJOR}.${ENCFS_MINOR}.${ENCFS_PATCH}") | set (ENCFS_VERSION "${ENCFS_MAJOR}.${ENCFS_MINOR}.${ENCFS_PATCH}") | |||
set (ENCFS_SOVERSION "${ENCFS_MAJOR}.${ENCFS_MINOR}") | set (ENCFS_SOVERSION "${ENCFS_MAJOR}.${ENCFS_MINOR}") | |||
set (ENCFS_NAME "Encrypted Filesystem") | set (ENCFS_NAME "Encrypted Filesystem") | |||
option(IWYU "Build with IWYU analysis." OFF) | option(IWYU "Build with IWYU analysis." OFF) | |||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} | set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} | |||
"${CMAKE_CURRENT_LIST_DIR}/cmake") | "${CMAKE_CURRENT_LIST_DIR}/cmake") | |||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} | set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} | |||
skipping to change at line 36 | skipping to change at line 38 | |||
option (USE_INTERNAL_EASYLOGGING "use built-in Easylogging++" ON) | option (USE_INTERNAL_EASYLOGGING "use built-in Easylogging++" ON) | |||
option (BUILD_SHARED_LIBS "build internal libraries as shared" OFF) | option (BUILD_SHARED_LIBS "build internal libraries as shared" OFF) | |||
option (ENABLE_NLS "compile with Native Language Support (using gettext)" ON) | option (ENABLE_NLS "compile with Native Language Support (using gettext)" ON) | |||
option (INSTALL_LIBENCFS "install libencfs" OFF) | option (INSTALL_LIBENCFS "install libencfs" OFF) | |||
option (LINT "enable lint output" OFF) | option (LINT "enable lint output" OFF) | |||
if (NOT DEFINED LIB_INSTALL_DIR) | if (NOT DEFINED LIB_INSTALL_DIR) | |||
set (LIB_INSTALL_DIR lib) | set (LIB_INSTALL_DIR lib) | |||
endif () | endif () | |||
if (CYGWIN) | ||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||||
set (CMAKE_INSTALL_PREFIX /usr) | ||||
endif() | ||||
endif() | ||||
# We need C++ 11 | # We need C++ 11 | |||
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0) | if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0) | |||
# CMake 3.1 has built-in CXX standard checks. | # CMake 3.1 has built-in CXX standard checks. | |||
set(CMAKE_CXX_STANDARD 11) | set(CMAKE_CXX_STANDARD 11) | |||
set(CMAKE_CXX_STANDARD_REQUIRED on) | set(CMAKE_CXX_STANDARD_REQUIRED on) | |||
else () | else () | |||
if (CMAKE_COMPILER_IS_GNUCXX) | if (CMAKE_COMPILER_IS_GNUCXX) | |||
message ("** Assuming that GNU CXX uses -std=c++11 flag for C++11 compatibil ity.") | message ("** Assuming that GNU CXX uses -std=c++11 flag for C++11 compatibil ity.") | |||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |||
skipping to change at line 76 | skipping to change at line 84 | |||
set(CMAKE_SKIP_BUILD_RPATH FALSE) | set(CMAKE_SKIP_BUILD_RPATH FALSE) | |||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) | set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) | |||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") | |||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | |||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/$ {LIB_INSTALL_DIR}" isSystemDir) | list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/$ {LIB_INSTALL_DIR}" isSystemDir) | |||
if("${isSystemDir}" STREQUAL "-1") | if("${isSystemDir}" STREQUAL "-1") | |||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") | |||
endif() | endif() | |||
endif() | endif() | |||
if (WIN32 OR APPLE) | if (CYGWIN OR WIN32 OR APPLE) | |||
set(DEFAULT_CASE_INSENSITIVE TRUE) | set(DEFAULT_CASE_INSENSITIVE TRUE) | |||
else() | else() | |||
set(DEFAULT_CASE_INSENSITIVE FALSE) | set(DEFAULT_CASE_INSENSITIVE FALSE) | |||
endif() | endif() | |||
if (CYGWIN) | ||||
find_program(PKILL NAMES "pkill") | ||||
if(NOT PKILL) | ||||
message(FATAL_ERROR "pkill not found, please install procps-ng package.") | ||||
endif() | ||||
endif() | ||||
# Check for FUSE. | # Check for FUSE. | |||
find_package (FUSE REQUIRED) | find_package (FUSE REQUIRED) | |||
include_directories (SYSTEM ${FUSE_INCLUDE_DIR}) | include_directories (SYSTEM ${FUSE_INCLUDE_DIR}) | |||
add_definitions (-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=29) | add_definitions (-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=29) | |||
if (CYGWIN) | ||||
# Cygwin build is intended to use WinFsp | ||||
add_definitions(-DCYGFUSE) | ||||
endif() | ||||
# Check for OpenSSL. | # Check for OpenSSL. | |||
find_package (OpenSSL REQUIRED) | find_package (OpenSSL REQUIRED) | |||
include_directories (SYSTEM ${OPENSSL_INCLUDE_DIR}) | include_directories (SYSTEM ${OPENSSL_INCLUDE_DIR}) | |||
find_program (POD2MAN pod2man) | find_program (POD2MAN pod2man) | |||
# Check for include files and stdlib properties. | # Check for include files and stdlib properties. | |||
include (CheckIncludeFileCXX) | include (CheckIncludeFileCXX) | |||
check_include_file_cxx (attr/xattr.h HAVE_ATTR_XATTR_H) | if (NOT CYGWIN) | |||
check_include_file_cxx (sys/xattr.h HAVE_SYS_XATTR_H) | check_include_file_cxx (attr/xattr.h HAVE_ATTR_XATTR_H) | |||
check_include_file_cxx (sys/xattr.h HAVE_SYS_XATTR_H) | ||||
endif() | ||||
include(CheckStructHasMember) | include(CheckStructHasMember) | |||
check_struct_has_member("struct dirent" d_type dirent.h HAVE_DIRENT_D_TYPE LANGU AGE CXX) | check_struct_has_member("struct dirent" d_type dirent.h HAVE_DIRENT_D_TYPE LANGU AGE CXX) | |||
# Check if xattr functions take extra arguments, as they do on OSX. | # Check if xattr functions take extra arguments, as they do on OSX. | |||
include (CheckCXXSourceCompiles) | include (CheckCXXSourceCompiles) | |||
check_cxx_source_compiles ("#include <sys/types.h> | check_cxx_source_compiles ("#include <sys/types.h> | |||
#include <sys/xattr.h> | #include <sys/xattr.h> | |||
int main() { getxattr(0,0,0,0,0,0); return 1; } | int main() { getxattr(0,0,0,0,0,0); return 1; } | |||
" XATTR_ADD_OPT) | " XATTR_ADD_OPT) | |||
skipping to change at line 142 | skipping to change at line 163 | |||
else() | else() | |||
check_function_exists_glibc (fdatasync HAVE_FDATASYNC) | check_function_exists_glibc (fdatasync HAVE_FDATASYNC) | |||
endif (APPLE) | endif (APPLE) | |||
set (CMAKE_THREAD_PREFER_PTHREAD) | set (CMAKE_THREAD_PREFER_PTHREAD) | |||
find_package (Threads REQUIRED) | find_package (Threads REQUIRED) | |||
# Logging. | # Logging. | |||
add_definitions (-DELPP_THREAD_SAFE -DELPP_DISABLE_DEFAULT_CRASH_HANDLING) | add_definitions (-DELPP_THREAD_SAFE -DELPP_DISABLE_DEFAULT_CRASH_HANDLING) | |||
add_definitions (-DELPP_NO_DEFAULT_LOG_FILE) | add_definitions (-DELPP_NO_DEFAULT_LOG_FILE) | |||
add_definitions (-DELPP_CUSTOM_COUT=std::cerr) | ||||
check_include_file_cxx (syslog.h HAVE_SYSLOG_H) | check_include_file_cxx (syslog.h HAVE_SYSLOG_H) | |||
if (HAVE_SYSLOG_H) | if (HAVE_SYSLOG_H) | |||
message ("-- Enabled syslog logging support") | message ("-- Enabled syslog logging support") | |||
add_definitions(-DELPP_SYSLOG) | add_definitions(-DELPP_SYSLOG) | |||
endif (HAVE_SYSLOG_H) | endif (HAVE_SYSLOG_H) | |||
# Packaging config. | # Packaging config. | |||
set (CPACK_PACKAGE_NAME "encfs") | set (CPACK_PACKAGE_NAME "encfs") | |||
set (CPACK_PACKAGE_VERSION_MAJOR ${ENCFS_MAJOR}) | set (CPACK_PACKAGE_VERSION_MAJOR ${ENCFS_MAJOR}) | |||
set (CPACK_PACKAGE_VERSION_MINOR ${ENCFS_MINOR}) | set (CPACK_PACKAGE_VERSION_MINOR ${ENCFS_MINOR}) | |||
End of changes. 8 change blocks. | ||||
4 lines changed or deleted | 26 lines changed or added |