summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 69229c09d4dbfe9018d0b32bb65f36a555b75674 (plain)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
cmake_minimum_required (VERSION 3.0.1)

#-----------------------------------------------------------------------------#

project(cvc4)

# Major component of the version of CVC4.
set(CVC4_MAJOR 1)
# Minor component of the version of CVC4.
set(CVC4_MINOR 7)
# Release component of the version of CVC4.
set(CVC4_RELEASE 0)
# Extraversion component of the version of CVC4.
set(CVC4_EXTRAVERSION "-prerelease")

# Full release string for CVC4.
if(CVC4_RELEASE)
  set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}${CVC4_EXTRAVERSION}")
else()
  set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}${CVC4_EXTRAVERSION}")
endif()

# Define to the full name of this package.
set(PACKAGE_NAME "${PROJECT_NAME}")

# Shared library versioning. Increment SOVERSION for every new CVC4 release.
set(CVC4_VERSION "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}")
set(CVC4_SOVERSION 5)

#### These defines are only use in autotools make files, will likely be 
#### replaced with corresponding CPack stuff
## Define to the full name and version of this package.
#set(PACKAGE_STRING "${PROJECT_NAME} ${CVC4_RELEASE_STRING}")
## Define to the one symbol short name of this package.
#set(PACKAGE_TARNAME "${PROJECT_NAME}")
## Define to the home page for this package.
#set(PACKAGE_URL "")
## Define to the version of this package.
#set(PACKAGE_VERSION "${CVC4_RELEASE_STRING}")
## Define to the address where bug reports for this package should be sent.
#set(PACKAGE_BUGREPORT "cvc4-bugs@cs.stanford.edu")

#-----------------------------------------------------------------------------#

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)

#-----------------------------------------------------------------------------#
# Macros

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

macro(add_c_flag flag)
  if(CMAKE_C_FLAGS)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
  else()
    set(CMAKE_C_FLAGS "${flag}")
  endif()
  message(STATUS "Configuring with C flag '${flag}'")
endmacro()

macro(add_cxx_flag flag)
  if(CMAKE_CXX_FLAGS)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
  else()
    set(CMAKE_CXX_FLAGS "${flag}")
  endif()
  message(STATUS "Configuring with CXX flag '${flag}'")
endmacro()

macro(add_c_cxx_flag flag)
  add_c_flag(${flag})
  add_cxx_flag(${flag})
endmacro()

macro(add_check_c_flag flag)
  string(REGEX REPLACE "[-=]" "_" flagname ${flag})
  check_c_compiler_flag("${flag}" HAVE_FLAG${flagname})
  if(HAVE_FLAG${flagname})
    add_c_flag(${flag})
  endif()
endmacro()

macro(add_check_cxx_flag flag)
  string(REGEX REPLACE "[-=]" "_" flagname ${flag})
  check_cxx_compiler_flag("${flag}" HAVE_FLAG${flagname})
  if(HAVE_FLAG${flagname})
    add_cxx_flag(${flag})
  endif()
endmacro()

macro(add_check_c_cxx_flag flag)
  add_check_c_flag(${flag})
  add_check_cxx_flag(${flag})
endmacro()

macro(add_required_cxx_flag flag)
  string(REGEX REPLACE "[-=]" "_" flagnamename ${flag})
  check_cxx_compiler_flag("${flag}" HAVE_FLAG${flagname})
  if (NOT HAVE_FLAG${flagname})
    message(FATAL_ERROR "Required compiler flag ${flag} not supported")
  endif()
  add_cxx_flag(${flag})
endmacro()

macro(add_required_c_flag flag)
  string(REGEX REPLACE "[-=]" "_" flagname ${flag})
  check_c_compiler_flag("${flag}" HAVE_FLAG${flagname})
  if (NOT HAVE_FLAG${flagname})
    message(FATAL_ERROR "Required compiler flag ${flag} not supported")
  endif()
  add_c_flag(${flag})
endmacro()

macro(add_required_c_cxx_flag flag)
  add_required_c_flag(${flag})
  add_required_cxx_flag(${flag})
endmacro()

# Collect all libraries that must be linked against libcvc4. These will be
# actually linked in src/CMakeLists.txt with target_link_libaries(...).
macro(libcvc4_link_libraries library)
  set(LIBCVC4_LIBRARIES ${LIBCVC4_LIBRARIES} ${library})
endmacro()

# Collect all include directories that are required for libcvc4. These will be
# actually included in src/CMakeLists.txt with target_include_directories(...).
macro(libcvc4_include_directories dirs)
  set(LIBCVC4_INCLUDES ${LIBCVC4_INCLUDES} ${dirs})
endmacro()

# CVC4 Boolean options are three-valued to detect if an option was set by the
# user. The available values are: IGNORE (default), ON, OFF
# Default options do not override options that were set by the user, i.e.,
# cvc4_set_option only sets an option if it's value is still IGNORE.
# This e.g., allows the user to disable proofs for debug builds (where proofs
# are enabled by default).
macro(cvc4_option var description)
  set(${var} IGNORE CACHE STRING "${description}")
  # Provide drop down menu options in cmake-gui
  set_property(CACHE ${var} PROPERTY STRINGS IGNORE ON OFF)
endmacro()

# Only set option if the user did not set an option.
macro(cvc4_set_option var value)
  if(${var} STREQUAL "IGNORE")
    set(${var} ${value})
  endif()
endmacro()

#-----------------------------------------------------------------------------#
# User options

# License
option(ENABLE_GPL "Enable GPL dependencies")

# General build options
#
# >> 3-valued: INGORE ON OFF
#    > allows to detect if set by user (default: IGNORE)
#    > only necessary for options set for build types
cvc4_option(ENABLE_ASAN          "Enable ASAN build")
cvc4_option(ENABLE_ASSERTIONS    "Enable assertions")
cvc4_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols")
cvc4_option(ENABLE_DUMPING       "Enable dumping")
cvc4_option(ENABLE_MUZZLE        "Supress ALL non-result output")
cvc4_option(ENABLE_OPTIMIZED     "Enable optimization")
cvc4_option(ENABLE_PORTFOLIO     "Enable portfolio support")
cvc4_option(ENABLE_PROOFS        "Enable proof support")
cvc4_option(ENABLE_REPLAY        "Enable the replay feature")
cvc4_option(ENABLE_STATISTICS    "Enable statistics")
cvc4_option(ENABLE_TRACING       "Enable tracing")
cvc4_option(ENABLE_UNIT_TESTING  "Enable unit testing")
cvc4_option(ENABLE_VALGRIND      "Enable valgrind instrumentation")
cvc4_option(ENABLE_SHARED        "Build as shared library")
# >> 2-valued: ON OFF
#    > for options where we don't need to detect if set by user (default: OFF)
option(ENABLE_BEST      "Enable dependencies known to give best performance")
option(ENABLE_COVERAGE  "Enable support for gcov coverage testing")
option(ENABLE_PROFILING "Enable support for gprof profiling")

# Optional dependencies
#
# >> 3-valued: INGORE ON OFF
#    > allows to detect if set by user (default: IGNORE)
#    > only necessary for options set for ENABLE_BEST
cvc4_option(USE_ABC      "Use ABC for AIG bit-blasting")
cvc4_option(USE_CLN      "Use CLN instead of GMP")
cvc4_option(USE_GLPK     "Use GLPK simplex solver")
cvc4_option(USE_READLINE "Use readline for better interactive support")
# >> 2-valued: ON OFF
#    > for options where we don't need to detect if set by user (default: OFF)
option(USE_CADICAL       "Use CaDiCaL SAT solver")
option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver")
option(USE_LFSC          "Use LFSC proof checker")
option(USE_SYMFPU        "Use SymFPU for floating point support")

# Custom install directories for dependencies
# If no directory is provided by the user, we first check if the dependency was
# installed via the corresponding contrib/get-* script and if not found, we
# check the intalled system version. If the user provides a directory we
# immediately fail if the dependency was not found at the specified location.
set(ABC_DIR           "" CACHE STRING "Set ABC install directory")
set(ANTLR_DIR         "" CACHE STRING "Set ANTLR3 install directory")
set(CADICAL_DIR       "" CACHE STRING "Set CaDiCaL install directory")
set(CRYPTOMINISAT_DIR "" CACHE STRING "Set CryptoMiniSat install directory")
set(GLPK_DIR          "" CACHE STRING "Set GLPK install directory")
set(GMP_DIR           "" CACHE STRING "Set GMP install directory")
set(LFSC_DIR          "" CACHE STRING "Set LFSC install directory")
set(SYMFPU_DIR        "" CACHE STRING "Set SymFPU install directory")

# Supported language bindings
option(BUILD_BINDINGS_JAVA   "Build Java bindings")
option(BUILD_BINDINGS_PYTHON "Build Python bindings")

# All bindings: c,java,csharp,perl,php,python,ruby,tcl,ocaml


#-----------------------------------------------------------------------------#
# Internal cmake variables

set(OPT_LEVEL 3)
set(GPL_LIBS "")

set(BUILD_TYPES Production Debug Testing Competition)

#-----------------------------------------------------------------------------#
# CVC4 build variables

set(CVC4_DEBUG 0)
set(CVC4_BUILD_PROFILE_PRODUCTION 0)
set(CVC4_BUILD_PROFILE_DEBUG 0)
set(CVC4_BUILD_PROFILE_TESTING 0)
set(CVC4_BUILD_PROFILE_COMPETITION 0)

#-----------------------------------------------------------------------------#
# Compiler flags

add_check_c_cxx_flag("-O${OPT_LEVEL}")
add_check_c_flag("-fexceptions")
add_check_c_cxx_flag("-Wno-deprecated")
add_check_cxx_flag("-Wsuggest-override")
add_check_cxx_flag("-Wnon-virtual-dtor")

#-----------------------------------------------------------------------------#
# Build types

if(ENABLE_ASAN)
  set(CMAKE_BUILD_TYPE Debug)
endif()

# Set the default build type to Production
if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Production CACHE STRING "Options are: ${BUILD_TYPES}" FORCE)
  # Provide drop down menu options in cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${BUILD_TYPES})
endif()
message(STATUS "Building ${CMAKE_BUILD_TYPE} build")

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  include(ConfigDebug)
elseif(CMAKE_BUILD_TYPE STREQUAL "Production")
  include(ConfigProduction)
elseif(CMAKE_BUILD_TYPE STREQUAL "Testing")
  include(ConfigTesting)
elseif(CMAKE_BUILD_TYPE STREQUAL "Competition")
  include(ConfigCompetition)
  # enable_static=yes
  #TODO
  # enable_static_binary=yes
  #TODO
endif()

#-----------------------------------------------------------------------------#
# Option defaults (three-valued options (cvc4_option(...)))

cvc4_set_option(ENABLE_PORTFOLIO OFF)
cvc4_set_option(ENABLE_SHARED ON)
cvc4_set_option(ENABLE_VALGRIND OFF)

#-----------------------------------------------------------------------------#
# Set options for best configuration

if (ENABLE_BEST)
  cvc4_set_option(USE_ABC ON)
  cvc4_set_option(USE_CLN ON)
  cvc4_set_option(USE_GLPK ON)
  cvc4_set_option(USE_READLINE ON)
endif()

#-----------------------------------------------------------------------------#

# This needs to be set before any find_package(...) command since we want to
# search for static libraries with suffix .a.
if(NOT ENABLE_SHARED)
  set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  set(CMAKE_EXE_LINKER_FLAGS "-static")
  set(BUILD_SHARED_LIBS OFF)
endif()

find_package(PythonInterp REQUIRED)

set(ANTLR_HOME ${ANTLR_DIR})
find_package(ANTLR REQUIRED)

# Java runtime is required for ANTLR
find_package(Java COMPONENTS Runtime REQUIRED)

set(GMP_HOME ${GMP_DIR})
find_package(GMP REQUIRED)
libcvc4_link_libraries(${GMP_LIBRARIES})
libcvc4_include_directories(${GMP_INCLUDE_DIR})


#-----------------------------------------------------------------------------#
# Enable the ctest testing framework

enable_testing()

#-----------------------------------------------------------------------------#

if(BUILD_BINDINGS_JAVA OR BUILD_BINDINGS_PYTHON)
  set(BUILD_BINDINGS TRUE)
endif()

if(ENABLE_ASAN)
  set(CMAKE_REQUIRED_LIBRARIES -fsanitize=address)
  add_required_c_cxx_flag("-fsanitize=address")
  unset(CMAKE_REQUIRED_LIBRARIES)
  add_required_c_cxx_flag("-fno-omit-frame-pointer")
  add_check_c_cxx_flag("-fsanitize-recover=address")
endif()

if(ENABLE_ASSERTIONS)
  add_definitions(-DCVC4_ASSERTIONS)
endif()

if(ENABLE_COVERAGE)
  include(CodeCoverage)
  APPEND_COVERAGE_COMPILER_FLAGS()
  add_definitions(-DCVC4_COVERAGE)
  setup_target_for_coverage_lcov(
    NAME coverage
    EXECUTABLE ctest $(ARGS)
    DEPENDENCIES cvc4-bin)
endif()

if(ENABLE_DUMPING)
  add_definitions(-DCVC4_DUMPING)
else()
  add_definitions(-DNDEBUG)
endif()

if(ENABLE_DEBUG_SYMBOLS)
  add_check_c_cxx_flag("-ggdb3")
endif()

if(ENABLE_MUZZLE)
  add_definitions(-DCVC4_MUZZLE)
endif()

if(ENABLE_PORTFOLIO)
  find_package(Boost 1.50.0 REQUIRED COMPONENTS thread)
  # Disable CLN for portfolio builds since it is not thread safe (uses an
  # unlocked hash table internally).
  set(USE_CLN OFF)
  set(THREADS_PREFER_PTHREAD_FLAG ON)
  find_package(Threads REQUIRED)
  if(THREADS_HAVE_PTHREAD_ARG)
    add_c_cxx_flag(-pthread)
  endif()
  add_definitions(-DCVC4_PORTFOLIO)
  set(BOOST_HAS_THREAD_ATTR 1)
endif()

if(ENABLE_PROFILING)
  add_definitions(-DCVC4_PROFILING)
  add_check_c_cxx_flag("-pg")
endif()

if(ENABLE_PROOFS)
  set(RUN_REGRESSION_ARGS ${RUN_REGRESSION_ARGS} --enable-proof)
  add_definitions(-DCVC4_PROOF)
  set(CVC4_PROOF 1)
  libcvc4_link_libraries(signatures)
endif()

if(ENABLE_REPLAY)
  add_definitions(-DCVC4_REPLAY)
endif()

if(ENABLE_TRACING)
  add_definitions(-DCVC4_TRACING)
  set(CVC4_TRACING 1)
endif()

if(ENABLE_UNIT_TESTING)
	find_package(CxxTest REQUIRED)
  # Force shared libs for unit tests, static libs with unit tests are not
  # working right now.
  set(ENABLE_SHARED ON)
endif()

if(ENABLE_SHARED)
  set(BUILD_SHARED_LIBS ON)
endif()

if(ENABLE_STATISTICS)
  add_definitions(-DCVC4_STATISTICS_ON)
endif()

if(ENABLE_VALGRIND)
  #TODO check if valgrind available
  add_definitions(-DCVC4_VALGRIND)
endif()

if(USE_ABC)
  set(ABC_HOME "${ABC_DIR}")
  find_package(ABC REQUIRED)
  libcvc4_link_libraries(${ABC_LIBRARIES})
  libcvc4_include_directories(${ABC_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_ABC ${ABC_ARCH_FLAGS})
endif()

if(USE_CADICAL)
  set(CaDiCaL_HOME ${CADICAL_DIR})
  find_package(CaDiCaL REQUIRED)
  libcvc4_link_libraries(${CaDiCaL_LIBRARIES})
  libcvc4_include_directories(${CaDiCaL_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_CADICAL)
endif()

if(USE_CLN)
  set(GPL_LIBS "${GPL_LIBS} cln")
  find_package(CLN 1.2.2 REQUIRED)
  libcvc4_link_libraries(${CLN_LIBRARIES})
  libcvc4_include_directories(${CLN_INCLUDE_DIR})
  set(CVC4_USE_CLN_IMP 1)
  set(CVC4_USE_GMP_IMP 0)
else()
  set(CVC4_USE_CLN_IMP 0)
  set(CVC4_USE_GMP_IMP 1)
endif()

if(USE_CRYPTOMINISAT)
  # CryptoMiniSat requires pthreads support
  set(THREADS_PREFER_PTHREAD_FLAG ON)
  find_package(Threads REQUIRED)
  if(THREADS_HAVE_PTHREAD_ARG)
    add_c_cxx_flag(-pthread)
  endif()
  set(CryptoMiniSat_HOME ${CRYPTOMINISAT_DIR})
  find_package(CryptoMiniSat REQUIRED)
  libcvc4_link_libraries(${CryptoMiniSat_LIBRARIES})
  libcvc4_include_directories(${CryptoMiniSat_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_CRYPTOMINISAT)
endif()

if(USE_GLPK)
  set(GPL_LIBS "${GPL_LIBS} glpk")
  set(GLPK_HOME ${GLPK_DIR})
  find_package(GLPK REQUIRED)
  libcvc4_link_libraries(${GLPK_LIBRARIES})
  libcvc4_include_directories(${GLPK_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_GLPK)
endif()

if(USE_LFSC)
  set(RUN_REGRESSION_ARGS ${RUN_REGRESSION_ARGS} --with-lfsc)
  set(LFSC_HOME ${LFSC_DIR})
  find_package(LFSC REQUIRED)
  libcvc4_link_libraries(${LFSC_LIBRARIES})
  libcvc4_include_directories(${LFSC_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_LFSC)
  set(CVC4_USE_LFSC 1)
else()
  set(CVC4_USE_LFSC 0)
endif()

if(USE_READLINE)
  find_package(Readline REQUIRED)
  set(HAVE_LIBREADLINE 1)
  if(Readline_COMPENTRY_FUNC_RETURNS_CHARPTR)
    set(READLINE_COMPENTRY_FUNC_RETURNS_CHARP 1)
  endif()
endif()

if(USE_SYMFPU)
  set(SymFPU_HOME ${SYMFPU_DIR})
  find_package(SymFPU REQUIRED)
  libcvc4_include_directories(${SymFPU_INCLUDE_DIR})
  add_definitions(-DCVC4_USE_SYMFPU)
  set(CVC4_USE_SYMFPU 1)
else()
  set(CVC4_USE_SYMFPU 0)
endif()

if(GPL_LIBS)
  if(NOT ENABLE_GPL)
    message(FATAL_ERROR
      "Bad configuration detected: BSD-licensed code only, but also requested "
      "GPLed libraries: ${GPL_LIBS}")
  endif()
  set(CVC4_GPL_DEPS 1)
endif()

#-----------------------------------------------------------------------------#

set(VERSION "1.6.0-prerelease")
string(TIMESTAMP MAN_DATE "%Y-%m-%d")

#-----------------------------------------------------------------------------#

include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_local_changes(GIT_IS_DIRTY)
if(${GIT_IS_DIRTY} STREQUAL "DIRTY")
  set(GIT_IS_DIRTY "true")
else()
  set(GIT_IS_DIRTY "false")
endif()

execute_process(
  COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD
  OUTPUT_VARIABLE GIT_BRANCH
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

#-----------------------------------------------------------------------------#

include(ConfigureCVC4)

# Defined if using the CLN multi-precision arithmetic library.
set(CVC4_CLN_IMP ${CVC4_USE_CLN_IMP})
# Defined if using the GMP multi-precision arithmetic library.
set(CVC4_GMP_IMP ${CVC4_USE_GMP_IMP})

configure_file(cvc4autoconfig.new.h.in cvc4autoconfig.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

#-----------------------------------------------------------------------------#

add_subdirectory(doc)
add_subdirectory(src)
if(BUILD_BINDINGS)
  add_subdirectory(src/bindings)
endif()
if(BUILD_BINDINGS_JAVA)
  add_subdirectory(test/java)
endif()
add_subdirectory(test/regress)
add_subdirectory(test/system)
if(ENABLE_UNIT_TESTING)
	add_subdirectory(test/unit)
endif()

if(ENABLE_PROOFS)
  add_subdirectory(proofs/signatures)
endif()

#-----------------------------------------------------------------------------#
# Print build configuration

if(CVC4_BUILD_PROFILE_PRODUCTION)
  set(CVC4_BUILD_PROFILE_STRING "production")
elseif(CVC4_BUILD_PROFILE_DEBUG)
  set(CVC4_BUILD_PROFILE_STRING "debug")
elseif(CVC4_BUILD_PROFILE_TESTING)
  set(CVC4_BUILD_PROFILE_STRING "testing")
elseif(CVC4_BUILD_PROFILE_COMPETITION)
  set(CVC4_BUILD_PROFILE_STRING "competition")
endif()

# Get all definitions added via add_definitions to print it below
get_directory_property(CVC4_DEFINITIONS COMPILE_DEFINITIONS)
string(REPLACE ";" " " CVC4_DEFINITIONS "${CVC4_DEFINITIONS}")

message("CVC4 ${CVC4_RELEASE_STRING}")
message("")
message("Build profile     : ${CVC4_BUILD_PROFILE_STRING}")
message("Optimized         : ${ENABLE_OPTIMIZED}")
message("Optimization level: ${OPTIMIZATION_LEVEL}")
message("Debug symbols     : ${ENABLE_DEBUG_SYMBOLS}")
message("Proofs            : ${ENABLE_PROOFS}")
message("Statistics        : ${ENABLE_STATISTICS}")
message("Replay            : ${ENABLE_REPLAY}")
message("Assertions        : ${ENABLE_ASSERTIONS}")
message("Tracing           : ${ENABLE_TRACING}")
message("Dumping           : ${ENABLE_DUMPING}")
message("Muzzle            : ${ENABLE_MUZZLE}")
message("")
message("Unit tests        : ${ENABLE_UNIT_TESTING}")
message("Coverage (gcov)   : ${ENABLE_COVERAGE}")
message("Profiling (gprof) : ${ENABLE_PROFILING}")
message("")
message("Shared libs       : ${ENABLE_SHARED}")
#message("Static binary: ${enable_static_binary}")
#message("Compat lib   : ${CVC4_BUILD_LIBCOMPAT}")
#message("Bindings     : ${bindings_to_be_built}")
#message("")
#message("Multithreaded: ${support_multithreaded}")
message("Portfolio         : ${ENABLE_PORTFOLIO}")
message("")
message("ABC               : ${USE_ABC}")
message("CaDiCaL           : ${USE_CADICAL}")
message("CryptoMiniSat     : ${USE_CRYPTOMINISAT}")
message("GLPK              : ${USE_GLPK}")
message("LFSC              : ${USE_LFSC}")
if(CVC4_USE_CLN_IMP)
  message("MP library        : cln")
else()
  message("MP library        : gmp")
endif()
message("Readline          : ${USE_READLINE}")
message("SymFPU            : ${USE_SYMFPU}")
message("")
message("CPPLAGS (-D...)   : ${CVC4_DEFINITIONS}")
message("CXXFLAGS          : ${CMAKE_CXX_FLAGS}")
message("CFLAGS            : ${CMAKE_C_FLAGS}")
#message("LIBS         : ${LIBS}")
#message("LDFLAGS      : ${LDFLAGS}")
#message("")
#message("libcvc4 version        : ${{CVC4_LIBRARY_VERSION}")
#message("libcvc4parser version  : ${CVC4_PARSER_LIBRARY_VERSION}")
#message("libcvc4compat version  : ${CVC4_COMPAT_LIBRARY_VERSION_or_nobuild}")
#message("libcvc4bindings version: ${CVC4_BINDINGS_LIBRARY_VERSION_or_nobuild}")
#message("")
message("Install prefix    : ${CMAKE_INSTALL_PREFIX}")
message("")

if(GPL_LIBS)
  message(
  "CVC4 license      : GPLv3 (due to optional libraries; see below)"
  "\n"
  "\n"
  "Please note that CVC4 will be built against the following GPLed libraries:"
  "\n"
  "${GPL_LIBS}"
  "\n"
  "As these libraries are covered under the GPLv3, so is this build of CVC4."
  "\n"
  "CVC4 is also available to you under the terms of the (modified) BSD license."
  "\n"
  "If you prefer to license CVC4 under those terms, please configure CVC4 to"
  "\n"
  "disable all optional GPLed library dependences (-DENABLE_BSD_ONLY=ON)."
  )
else()
  message(
  "CVC4 license      : modified BSD"
  "\n"
  "\n"
  "Note that this configuration is NOT built against any GPL'ed libraries, so"
  "\n"
  "it is covered by the (modified) BSD license.  This is, however, not the best"
  "\n"
  "performing configuration of CVC4.  To build against GPL'ed libraries which"
  "\n"
  "improve CVC4's performance, re-configure with '-DENABLE_GPL -DENABLE_BEST'."
  )
endif()

message("")
message("Now just type make, followed by make check or make install.")
message("")
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback