forked from niklasso/minisatp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (64 loc) · 2.54 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
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(minisatp)
#--------------------------------------------------------------------------------------------------
# Configurable options:
option(STATIC_BINARIES "Link binaries statically." ON)
option(USE_SORELEASE "Use SORELEASE in shared library filename." ON)
#--------------------------------------------------------------------------------------------------
# Library version:
set(MINISATP_SOMAJOR 1)
set(MINISATP_SOMINOR 1)
set(MINISATP_SORELEASE 0)
# Compute VERSION and SOVERSION:
if(USE_SORELEASE)
set(MINISATP_VERSION ${MINISATP_SOMAJOR}.${MINISATP_SOMINOR}.${MINISATP_SORELEASE})
else()
set(MINISATP_VERSION ${MINISATP_SOMAJOR}.${MINISATP_SOMINOR})
endif()
set(MINISATP_SOVERSION ${MINISATP_SOMAJOR})
#--------------------------------------------------------------------------------------------------
# Compile flags:
add_definitions(-include Global.h -include Main.h -D_FILE_OFFSET_BITS=64)
#--------------------------------------------------------------------------------------------------
# Dependencies:
find_package(GMP REQUIRED)
include_directories(${GMP_INCLUDE_DIR})
include_directories(${minisat_SOURCE_DIR})
include_directories(${minisatp_SOURCE_DIR})
include_directories(${minisatp_SOURCE_DIR}/ADTs)
#--------------------------------------------------------------------------------------------------
# Build Targets:
set(MINISATP_LIB_SOURCES
ADTs/FEnv.cc
ADTs/File.cc
ADTs/Global.cc
Debug.cc
Hardware_adders.cc
Hardware_clausify.cc
Hardware_sorters.cc
Main.cc
PbParser.cc
PbSolver.cc
PbSolver_convert.cc
PbSolver_convertAdd.cc
PbSolver_convertBdd.cc
PbSolver_convertSort.cc)
add_library(minisatp-lib-static STATIC ${MINISATP_LIB_SOURCES})
add_library(minisatp-lib-shared SHARED ${MINISATP_LIB_SOURCES})
target_link_libraries(minisatp-lib-shared minisat-lib-shared ${GMP_LIBRARY})
target_link_libraries(minisatp-lib-static minisat-lib-static ${GMP_LIBRARY})
set_target_properties(minisatp-lib-static PROPERTIES OUTPUT_NAME "minisatp")
set_target_properties(minisatp-lib-shared
PROPERTIES
OUTPUT_NAME "minisatp"
VERSION ${MINISATP_VERSION}
SOVERSION ${MINISATP_SOVERSION})
add_executable(minisatp Main.cc)
target_link_libraries(minisatp minisatp-lib-static)
if(STATIC_BINARIES)
target_link_libraries(minisatp minisatp-lib-static)
else()
target_link_libraries(minisatp minisatp-lib-shared)
endif()
#--------------------------------------------------------------------------------------------------
# Installation targets: