-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
179 lines (155 loc) · 6.11 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Notices:
#
# Copyright 2017 United States Government as represented by the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Disclaimers:
#
# No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED,
# IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT
# SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS,
# HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS
# IS."
#
# Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT,
# ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING
# FROM, RECIPIENT'S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH
# MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
cmake_minimum_required(VERSION 3.12)
project(Kodiak)
############################################################
#
# Import FILIB
#
############################################################
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
find_package(FILIB REQUIRED)
############################################################
#
# Language and compilation flags
#
############################################################
if (DEFINED ENV{CXXFLAGS})
message(WARNING "\$ENV{CXXFLAGS} exists: using it for extra compilation options")
set(CXXFLAGS $ENV{CXXFLAGS})
separate_arguments(CXXFLAGS)
endif()
if (DEFINED ENV{CXXLNFLAGS})
message(WARNING "\$ENV{CXXLNFLAGS} exists: using it for extra linking options")
set(CXXLNFLAGS $ENV{CXXLNFLAGS})
separate_arguments(CXXLNFLAGS)
endif()
add_compile_options("-std=c++14" "-fPIC" ${CXXFLAGS})
add_compile_options("-Wno-unused-command-line-argument")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(STATUS "GCC detected: adding specific flags")
add_compile_options("-frounding-math")
endif()
if(${DEBUG})
message(WARNING "Building in DEBUGGING mode: all optimizations are disabled")
add_definitions(-DDEBUG=1)
add_compile_options("-Wall" "-pedantic" "-Wextra")
add_compile_options("-g" "-O0" "-fsanitize=undefined")
add_link_options("-fsanitize=undefined")
else()
add_compile_options("-O3")
endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
message(STATUS "OS X found: adding specific linker options")
add_link_options("-undefined" "dynamic_lookup" ${CXXLNFLAGS})
endif()
############################################################
#
# Kodiak
#
############################################################
add_library(KodiakObjects OBJECT
src/Bifurcation.cpp
src/Bifurcation.hpp
src/Expressions/Boolean/Bool.cpp
src/Expressions/Boolean/Bool.hpp
src/BranchAndBoundDF.hpp
src/kodiak.hpp
src/MinMax.cpp
src/MinMax.hpp
src/MinMaxSystem.cpp
src/MinMaxSystem.hpp
src/Node.cpp
src/Node.hpp
src/Paver.cpp
src/Paver.hpp
src/Real.cpp
src/Real.hpp
src/System.cpp
src/System.hpp
src/types.cpp
src/types.hpp
src/Expressions/Boolean/LegacyCertainty.cpp
src/Expressions/Boolean/LegacyCertainty.hpp
src/Expressions/Boolean/ConstantNode.cpp
src/Expressions/Boolean/ConstantNode.hpp
src/Expressions/Boolean/Node.cpp
src/Expressions/Boolean/Node.hpp
src/Expressions/Boolean/Certainty.cpp
src/Expressions/Boolean/Certainty.hpp
src/LegacyBool.cpp
src/LegacyBool.hpp
src/Value.hpp
src/Environment.cpp
src/Environment.hpp
src/NewPaver.cpp
src/NewPaver.hpp
src/NewMinMaxSystem.cpp
src/NewMinMaxSystem.hpp
src/Adapters/PRECiSA.cpp
src/Adapters/PRECiSA.hpp
src/Adapters/Codiak.h
src/Adapters/Codiak.cpp
src/Expressions/Boolean/NotNode.cpp
src/Expressions/Boolean/NotNode.hpp
src/Expressions/Boolean/RelationNode.cpp
src/Expressions/Boolean/RelationNode.hpp
src/Expressions/Boolean/AndNode.cpp
src/Expressions/Boolean/AndNode.hpp
src/Expressions/Boolean/OrNode.cpp
src/Expressions/Boolean/OrNode.hpp
src/Expressions/Boolean/ImplicationNode.cpp
src/Expressions/Boolean/ImplicationNode.hpp
src/Expressions/Boolean/InvalidBooleanNode.cpp
src/Expressions/Boolean/InvalidBooleanNode.hpp
src/Expressions/Boolean/VariableNode.cpp
src/Expressions/Boolean/VariableNode.hpp
src/BooleanChecker.cpp
src/BooleanChecker.hpp
)
target_include_directories(KodiakObjects
PUBLIC
src
src/Adapters
)
target_link_libraries(KodiakObjects
PUBLIC
FILIB::filib++
$<$<BOOL:${DEBUG}>:boost_serialization>
)
############################################################
#
# Kodiak Libraries
#
############################################################
add_library(KodiakDynamic SHARED $<TARGET_OBJECTS:KodiakObjects>)
target_link_libraries(KodiakDynamic PUBLIC KodiakObjects)
set_target_properties(KodiakDynamic PROPERTIES OUTPUT_NAME kodiak)
add_library(KodiakStatic STATIC $<TARGET_OBJECTS:KodiakObjects>)
target_link_libraries(KodiakStatic PUBLIC KodiakObjects)
set_target_properties(KodiakStatic PROPERTIES OUTPUT_NAME kodiak)
install(TARGETS KodiakDynamic KodiakStatic)
############################################################
#
# Other modules
#
############################################################
add_subdirectory(examples)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_subdirectory(tests)
endif()