2018-05-17 18:55:15 +02:00
|
|
|
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
2018-05-19 22:53:21 +02:00
|
|
|
cmake_policy(SET CMP0054 NEW)
|
2016-01-12 14:21:57 +01:00
|
|
|
|
2017-10-27 05:02:51 +02:00
|
|
|
# note: for clang-tidy, we need cmake 3.6, or (if the return code should be handled correctly, e.g. on CI), we need 3.8.
|
|
|
|
|
2018-05-19 23:42:00 +02:00
|
|
|
# TODO Perf test:
|
|
|
|
# - try if setting CRYPTOPP_NATIVE_ARCH=ON and adding -march=native to the compile commands for cryfs source files makes a difference
|
|
|
|
# -> if yes, offer a cmake option to enable both of these
|
|
|
|
|
2016-06-01 14:19:17 +02:00
|
|
|
project(cryfs)
|
|
|
|
|
2016-02-11 12:04:49 +01:00
|
|
|
include(utils.cmake)
|
2015-02-17 01:02:15 +01:00
|
|
|
|
2018-05-28 23:54:17 +02:00
|
|
|
require_gcc_version(5.0)
|
|
|
|
require_clang_version(4.0)
|
2015-03-16 02:15:51 +01:00
|
|
|
|
2016-02-14 16:25:21 +01:00
|
|
|
# Default value is not to build test cases
|
2018-05-20 23:11:54 +02:00
|
|
|
option(BUILD_TESTING "build test cases" OFF)
|
|
|
|
option(CRYFS_UPDATE_CHECKS "let cryfs check for updates and security vulnerabilities" ON)
|
2018-05-20 23:15:18 +02:00
|
|
|
option(DISABLE_OPENMP "allow building without OpenMP libraries. This will cause performance degradations." OFF)
|
2016-02-14 17:06:06 +01:00
|
|
|
|
2018-04-16 06:37:06 +02:00
|
|
|
# Default value is to build in release mode
|
2016-02-14 17:06:06 +01:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE INTERNAL "CMAKE_BUILD_TYPE")
|
|
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
2016-02-14 16:25:21 +01:00
|
|
|
|
2018-07-18 06:08:17 +02:00
|
|
|
# The MSVC version on AppVeyor CI needs this
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(/bigobj)
|
|
|
|
endif()
|
2016-09-24 13:16:26 +02:00
|
|
|
|
2016-02-10 00:58:03 +01:00
|
|
|
add_subdirectory(vendor)
|
|
|
|
add_subdirectory(src)
|
2017-03-26 15:08:47 +02:00
|
|
|
add_subdirectory(doc)
|
2016-02-10 00:58:03 +01:00
|
|
|
add_subdirectory(test)
|
2016-02-11 17:34:08 +01:00
|
|
|
add_subdirectory(cpack)
|