forked from iwhisperio/libcrystal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (32 loc) · 1.27 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
cmake_minimum_required(VERSION 2.9)
cmake_policy(VERSION 2.9)
project(libcrystal C)
cmake_policy(SET CMP0054 NEW)
# set(CMAKE_VERBOSE_MAKEFILE TRUE)
if(WIN32)
set(ENABLE_SHARED_DEFAULT TRUE)
set(ENABLE_STATIC_DEFAULT FALSE)
else()
set(ENABLE_SHARED_DEFAULT TRUE)
set(ENABLE_STATIC_DEFAULT TRUE)
endif()
set(ENABLE_SHARED ${ENABLE_SHARED_DEFAULT} CACHE BOOL "Build shared library")
set(ENABLE_STATIC ${ENABLE_STATIC_DEFAULT} CACHE BOOL "Build static library")
set(ENABLE_CRYPTO FALSE CACHE BOOL "Enable crypto functions, depends on libsodium")
set(ENABLE_BASE58 TRUE CACHE BOOL "Enable base58 functions")
set(ENABLE_TESTS TRUE CACHE BOOL "Build test cases")
set(WITH_LIBCUNIT "${CMAKE_INSTALL_PREFIX}" CACHE PATH "where to look for cunit")
set(WITH_LIBSODIUM "${CMAKE_INSTALL_PREFIX}" CACHE PATH "where to look for libsodium")
set(LIBSODIUM_STATIC FALSE CACHE BOOL "Set to TRUE if libsodium is static library")
if(WIN32)
set(WITH_PTHREAD "${CMAKE_INSTALL_PREFIX}" CACHE PATH "where to look for pthread")
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${WITH_PTHREAD}/include")
endif()
if(APPLE)
set(CMAKE_MACOSX_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
add_subdirectory(src)
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()