forked from IBM/libgroupsig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
83 lines (68 loc) · 2.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# CMake requirements
cmake_minimum_required (VERSION 3.13)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
# Generic library information
project (libgroupsig)
set (libgroupsig_VERSION_MAJOR 1)
set (libgroupsig_VERSION_MINOR 0)
set (libgroupsig_VERSION_PATCH 0)
# Set the paths for produced libraries and runtime binaries
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# Global compiler flags
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
# Add the binary tree to the search path for include files
include_directories("${CMAKE_SOURCE_DIR}/src")
include_directories("${CMAKE_SOURCE_DIR}/src/include")
include_directories("${CMAKE_BINARY_DIR}/external/include")
link_directories("${CMAKE_BINARY_DIR}/external/lib")
# Check dependencies
## OpenSSL
find_package (OpenSSL REQUIRED)
# Add modules
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
## Configure options
option (
USE_GTEST
"Build with GoogleTest for testing.")
option (
USE_GCOV
"Build with GCov for coverage reporting.")
option (
USE_MCL
"Build a local version of MCL for pairing based crypto."
ON)
## Google Test
if (USE_GTEST)
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -fprofile-arcs -ftest-coverage")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_TEST_COMPILE_FLAGS}" )
include (gtest)
endif (USE_GTEST)
## GCOV
if (USE_GCOV)
include (gcovr)
endif (USE_GCOV)
## MCL
if (USE_MCL)
include (mcl)
# link_directories("${CMAKE_BINARY_DIR}/external/kk/lib")
else ()
find_package (MCL REQUIRED)
include_directories(${MCL_INCLUDE_DIRS})
endif (USE_MCL)
## @TODO Is this needed/used?
## CTest
include (CTest)
# Subdirectories
add_subdirectory (${CMAKE_SOURCE_DIR}/src/logger)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/msg)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/sys)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/shim)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/crypto)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/math)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/misc)
add_subdirectory (${CMAKE_SOURCE_DIR}/src/groupsig)
add_subdirectory (${PROJECT_SOURCE_DIR}/src/tools)