-
Notifications
You must be signed in to change notification settings - Fork 91
/
CMakeLists.txt
56 lines (39 loc) · 1.31 KB
/
CMakeLists.txt
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
54
55
56
cmake_minimum_required(VERSION 3.9.0)
set(CMAKE_C_STANDARD 99)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
project(WickrCryptoC)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 18)
set(VERSION_PATCH 3)
include(GNUInstallDirs)
set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} CACHE INTERNAL "")
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET AND APPLE AND NOT IOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
endif()
set(OPENSSL_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET} CACHE INTERNAL "")
if(IOS_DEPLOYMENT_TARGET)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=${IOS_DEPLOYMENT_TARGET}")
endif()
if (ANDROID)
set(HAVE_POSIX_MEMALIGN_EXITCODE 0)
set(HAVE_POSIX_MEMALIGN_EXITCODE__TRYRUN_OUTPUT 0)
endif()
option(BUILD_TESTS "build tests" OFF)
option(BUILD_OPENSSL "Force building OpenSSL" OFF)
if (WIN32 OR APPLE OR ANDROID)
set(OPENSSL_AUTO_BUILD_DEFAULT TRUE)
else ()
set(OPENSSL_AUTO_BUILD_DEFAULT FALSE)
endif ()
option(OPENSSL_AUTO_BUILD "Automatically build OpenSSL if not found" ${OPENSSL_AUTO_BUILD_DEFAULT})
add_subdirectory(third-party)
option(DEPS_ONLY "only build dependencies" OFF)
if(BUILD_TESTS)
enable_testing()
endif()
if(NOT DEPS_ONLY)
add_subdirectory(src)
endif()
if(BUILD_TESTS)
add_subdirectory(test)
endif()