-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
97 lines (81 loc) · 2.83 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
cmake_minimum_required (VERSION 3.6)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
project(percy LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (UNIX)
set(CMAKE_CXX_FLAGS "-Wall -pedantic -fPIC ${CMAKE_CXX_FLAGS} -DLIN64")
endif()
option(TRAVIS_BUILD "Use Travis build configuration" OFF)
option(PERCY_EXAMPLES "Build examples" ON)
option(PERCY_TEST "Build tests" OFF)
option(PERCY_BENCH "Build benchmarks" OFF)
option(PERCY_BUILD_KITTY "Build kitty for percy" ON)
option(PERCY_USE_SYRUP "Use glucose-syrup instead of glucose" ON)
option(PERCY_USE_GLUCOSE "Use glucose instead of glucose-syrup" OFF)
option(PERCY_BUILD_CMS "Enables support for CryptoMinisat" OFF)
option(STATIC_LIBABC "Builds libabc as a static library" ON)
option(DISABLE_NAUTY "Disables the Nauty library" OFF)
option(PERCY_SATOKO "Enable support for the Satoko solver" ON)
if (${TRAVIS_BUILD})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRAVIS_BUILD -Wno-sign-compare -Wno-parentheses")
endif()
# Glucose and Glucose-Syrup don't build properly on Windows
if (UNIX)
find_package(ZLIB REQUIRED)
if (${PERCY_USE_SYRUP})
find_package(Threads REQUIRED)
add_subdirectory(syrup)
elseif(${PERCY_USE_GLUCOSE})
add_subdirectory(glucose)
endif()
endif()
if (${PERCY_BUILD_KITTY})
add_subdirectory(kitty EXCLUDE_FROM_ALL)
endif()
if (${PERCY_BUILD_CMS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_CMS")
set(ONLY_SIMPLE ON CACHE BOOL "Build simple version of CMS")
set(ENABLE_PYTHON_INTERFACE OFF CACHE BOOL "Do not build Python inferface")
set(IPASIR OFF CACHE BOOL "We do not need IPASIR")
add_subdirectory(cryptominisat)
SET(CMS_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/cryptominisat/cmsat5-src")
if (WIN32)
link_directories("${PROJECT_BINARY_DIR}/cryptominisat/lib/Debug")
link_directories("${PROJECT_BINARY_DIR}/cryptominisat/lib/Release")
else()
SET(CMS_LDIR "${CMAKE_CURRENT_BINARY_DIR}/cryptominisat/lib")
link_directories(${CMS_LDIR})
endif()
endif()
if (${PERCY_SATOKO})
add_subdirectory(satoko)
endif()
if (${PERCY_BENCH})
add_subdirectory(bench)
endif()
set(ABC_USE_NAMESPACE "pabc")
add_subdirectory(abc)
if (UNIX)
target_compile_definitions(libabcsat PUBLIC "LIN64" ABC_NAMESPACE=pabc ABC_NO_USE_READLINE)
elseif(WIN32)
target_compile_definitions(libabcsat PUBLIC ABC_NAMESPACE=pabc ABC_USE_NO_READLINE NOMINMAX)
if (STATIC_LIBABC)
target_compile_definitions(libabcsat PUBLIC WIN32_NO_DLL)
endif()
endif()
# Nauty does not seem to compile on Windows
if (WIN32)
set(DISABLE_NAUTY ON)
endif()
if (NOT ${DISABLE_NAUTY})
add_subdirectory(nauty)
endif()
add_subdirectory(include)
if(PERCY_EXAMPLES)
add_subdirectory(examples)
endif()
if (${PERCY_TEST})
enable_testing()
add_subdirectory(test)
endif()