-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
69 lines (62 loc) · 2.75 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
57
58
59
60
61
62
63
64
65
66
67
68
69
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project("erpiko" LANGUAGES CXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(warnings "/EHsc")
endif()
if (NOT CONFIGURED_ONCE)
if (NOT MSVC)
set(CMAKE_CXX_FLAGS " ${warnings}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
endif()
endif()
find_package(CUDA)
if (${CUDA_VERSION})
if (NOT DISABLE_CUDA)
include(FindCUDA)
add_definitions(-DENABLE_CUDA)
message(STATUS "Cuda is found and enabled")
set(ENABLE_CUDA 1)
include_directories(${CUDA_INCLUDE_DIRS})
else()
message(STATUS "Cuda is found but disabled")
endif()
else()
message(STATUS "Cuda is not found")
endif()
include_directories(include)
include_directories(deps/libressl/include)
include_directories(deps/libressl-portable-tip/include)
add_library(libresslcrypto STATIC IMPORTED)
add_library(libresslcryptocompat STATIC IMPORTED)
add_library(libresslssl STATIC IMPORTED)
add_library(libressltls STATIC IMPORTED)
if (NOT MSVC)
if(EXISTS "${CMAKE_SOURCE_DIR}/deps/libressl/crypto/libcrypto.a")
set_property(TARGET libresslcrypto PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/crypto//libcrypto.a)
set_property(TARGET libresslssl PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/ssl/libssl.a)
set_property(TARGET libressltls PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/tls/libtls.a)
else ()
set_property(TARGET libresslcrypto PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/crypto/.libs/libcrypto.a)
set_property(TARGET libresslssl PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/ssl/.libs/libssl.a)
set_property(TARGET libressltls PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/tls/.libs/libtls.a)
endif()
else()
if (MSVC_C_ARCHITECTURE_ID MATCHES 64 OR MSVC_CXX_ARCHITECTURE_ID MATCHES 64)
set_property(TARGET libresslcrypto PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/crypto/${CMAKE_BUILD_TYPE}/crypto.lib)
set_property(TARGET libresslssl PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/ssl/${CMAKE_BUILD_TYPE}/ssl.lib)
else()
set_property(TARGET libresslcrypto PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/crypto/crypto.lib)
set_property(TARGET libresslssl PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/deps/libressl/ssl/ssl.lib)
endif()
endif()
enable_testing()
add_subdirectory(src)
add_subdirectory(tests)
set(CONFIGURED_ONCE TRUE CACHE INTERNAL
"A flag showing that CMake has configured at least once.")