-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
98 lines (76 loc) · 2.85 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cmake_minimum_required(VERSION 3.5)
project(LydiaSyft)
include(FetchContent)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INSTALL_PREFIX /usr/local)
add_definitions( -D__ROOT_DIRECTORY="${CMAKE_SOURCE_DIR}" )
set(CMAKE_MODULE_PATH
"${CMAKE_MODULE_PATH}"
"${CMAKE_ROOT_DIR}/cmake/Modules"
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
# TODO: make it configurable
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
#set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
if (NOT DEFINED CUDD_USE_STATIC_LIBS)
set(CUDD_USE_STATIC_LIBS ON)
endif()
find_package(cudd REQUIRED)
if (NOT DEFINED MONA_USE_STATIC_LIBS)
set(MONA_USE_STATIC_LIBS ON)
endif()
find_package(mona REQUIRED)
if (NOT DEFINED Z3_FETCH)
set(Z3_FETCH ON)
endif()
if (Z3_FETCH)
message("-- since Z3_FETCH is ${Z3_FETCH}, the Z3 project will be fetched and built from source")
set(Z3_BUILD_LIBZ3_SHARED OFF)
FetchContent_Declare(z3
GIT_REPOSITORY https://github.com/Z3Prover/z3
GIT_TAG z3-4.8.12
)
FetchContent_MakeAvailable(z3)
set(Z3_INCLUDE_DIR ${z3_SOURCE_DIR}/src/api/c++)
set(Z3_LIBRARY libz3)
else()
message("-- since Z3_FETCH is ${Z3_FETCH}, the Z3 project is assumed to be found in the local filesystem")
find_package(Z3 REQUIRED)
endif()
if (NOT DEFINED LYDIASYFT_ENABLE_TESTS)
set(LYDIASYFT_ENABLE_TESTS ON)
endif()
if (LYDIASYFT_ENABLE_TESTS)
message("-- LydiaSyft tests enabled")
else()
message("-- LydiaSyft tests disabled")
endif()
if (NOT DEFINED LYDIASYFT_ENABLE_EXAMPLES)
set(LYDIASYFT_ENABLE_EXAMPLES ON)
endif()
if (LYDIASYFT_ENABLE_EXAMPLES)
message("-- LydiaSyft examples enabled")
else()
message("-- LydiaSyft examples disabled")
endif()
set(LYDIA_DIR ${PROJECT_SOURCE_DIR}/submodules/lydia)
set(WITH_SYFT OFF)
set(LYDIA_ENABLE_TESTS OFF)
set(LYDIA_ENABLE_BENCHMARK OFF)
add_subdirectory(${LYDIA_DIR})
set(LYDIA_LIBRARIES lydia)
set(LYDIA_INCLUDE_DIR ${LYDIA_DIR}/lib/include)
set(LYDIA_THIRD_PARTY_INCLUDE_PATH "${LYDIA_DIR}/third_party/spdlog/include;${LYDIA_DIR}/third_party/CLI11/include;/usr/local/include;/usr/local/include;/usr/local/include;${LYDIA_DIR}/third_party/google/benchmark/include;/usr/include")
set(EXT_LIBRARIES_PATH lydia ${CUDD_LIBRARIES} ${MONA_DFA_LIBRARIES} ${MONA_BDD_LIBRARIES} ${MONA_MEM_LIBRARIES} ${Z3_LIBRARY})
set(EXT_INCLUDE_PATH ${LYDIA_INCLUDE_DIR} ${LYDIA_THIRD_PARTY_INCLUDE_PATH} ${CUDD_INCLUDE_DIRS} ${MONA_MEM_INCLUDE_DIRS} ${MONA_BDD_INCLUDE_DIRS} ${MONA_DFA_INCLUDE_DIRS} ${Z3_INCLUDE_DIR})
message(STATUS EXT_LIBRARIES_PATH ${EXT_LIBRARIES_PATH})
enable_testing()
add_subdirectory(src)
if (LYDIASYFT_ENABLE_TESTS)
add_subdirectory(test)
endif()
if (LYDIASYFT_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()