-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
102 lines (81 loc) · 3.7 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
cmake_minimum_required( VERSION 3.3 )
cmake_policy( SET CMP0057 NEW )
project( "QuickSolve" VERSION 1.0 LANGUAGES C )
set( QS_INTEGRAL_POWERTYPE_VALID "char" "int" "long" )
set( QS_DEBUG_LEVEL_VALID "0" "1" "2" "3" )
set( QS_BUILD_SSRENDERER "ON" CACHE BOOL "Build the subsampling renderer" )
set( QS_BUILD_QUICKSOLVE "ON" CACHE BOOL "Build Quicksolve" )
set( QS_BUILD_QUICKCHECK "ON" CACHE BOOL "Build Quickcheck" )
set( QS_JEMALLOC "ON" CACHE BOOL "Link QuickLib against jemalloc allocator" )
set( QS_STATUS "ON" CACHE BOOL "Generate status output" )
set( QS_BUILD_TESTS "ON" CACHE BOOL "Build unit tests" )
set( QS_FERMAT_BINARY "fermat" CACHE STRING "Name of FERMAT binary" )
set( QS_FERMAT_BINARY_NUMERIC "fermat" CACHE STRING "Name of numeric FERMAT binary" )
if( NOT "${QS_INTEGRAL_POWERTYPE}" IN_LIST QS_INTEGRAL_POWERTYPE_VALID )
set( QS_INTEGRAL_POWERTYPE "char" CACHE STRING "Type of Powers in Database ([char],int,long)" FORCE )
endif( )
if( NOT "${QS_DEBUG_LEVEL}" IN_LIST QS_DEBUG_LEVEL_VALID )
set( QS_DEBUG_LEVEL "1" CACHE STRING "Debug verbosity ([0,...,3])" FORCE )
endif( )
set( QS_DEBUG_EVAL "OFF" CACHE BOOL "Write CAS communication into logfile" )
if( QS_DEBUG_EVAL )
set( QS_DEBUG_EVALFILE ".fermat.log." CACHE STRING "Basename for logfile of evaluator" )
add_definitions( "-D'DBG_EVALFILE=\"${QS_DEBUG_EVALFILE}\"'" )
else( )
unset( QS_DEBUG_EVALFILE CACHE )
endif( )
add_definitions( "-D'DBG_LEVEL=${QS_DEBUG_LEVEL}'" )
add_definitions( "-D'FERMAT_BINARY=\"${QS_FERMAT_BINARY}\"'" )
add_definitions( "-D'FERMAT_BINARY_NUMERIC=\"${QS_FERMAT_BINARY_NUMERIC}\"'" )
add_definitions( "-DQS_INTEGRAL_POWERTYPE=${QS_INTEGRAL_POWERTYPE}" )
if( "${QS_DEBUG_LEVEL}" LESS "1" )
add_definitions( "-D'DBG_PRINT( fmt,... )='" )
add_definitions( "-D'DBG_APPEND( ... )='" )
else( )
add_definitions( "-D'DBG_PRINT( fmt,indent,... )=printf(\"%4i | %*s\" fmt,indent,indent,\"\",##__VA_ARGS__ )'" )
add_definitions( "-D'DBG_APPEND( ... )=printf( __VA_ARGS__ )'" )
endif( )
if( "${QS_DEBUG_LEVEL}" LESS "2" )
add_definitions( "-D'DBG_PRINT_2( ... )='" )
add_definitions( "-D'DBG_APPEND_2( ... )='" )
else( )
add_definitions( "-D'DBG_PRINT_2( ... )=DBG_PRINT( __VA_ARGS__ )'" )
add_definitions( "-D'DBG_APPEND_2( ... )=DBG_APPEND( __VA_ARGS__ )'" )
endif( )
if( "${QS_DEBUG_LEVEL}" LESS "3" )
add_definitions( "-D'DBG_PRINT_3( ... )='" )
add_definitions( "-D'DBG_APPEND_3( ... )='" )
else( )
add_definitions( "-D'DBG_PRINT_3( ... )=DBG_PRINT( __VA_ARGS__ )'" )
add_definitions( "-D'DBG_APPEND_3( ... )=DBG_APPEND( __VA_ARGS__ )'" )
endif( )
if( QS_STATUS )
add_definitions( "-DQS_STATUS" )
endif( )
find_path( KYOTO_INCLUDE_DIR "kclangc.h" DOC "Directory of kclangc.h" )
find_library( KYOTO_LIB "kyotocabinet" DOC "Path to libkyotocabinet" )
add_library( db "src/db.c" )
add_library( quicklib "src/pivotgraph.c" "src/integralmgr.c" "src/integral.c" "src/coefficient.c" "src/operand.c" "src/expression.c" "src/print.c" )
if( "${QS_JEMALLOC}" )
target_link_libraries( quicklib jemalloc )
endif( )
target_link_libraries( db "${KYOTO_LIB}" stdc++ m z )
include_directories( "${KYOTO_INCLUDE_DIR}" )
if( "${QS_BUILD_QUICKSOLVE}" )
add_executable( quicksolve "quicksolve.c" )
target_link_libraries( quicksolve quicklib db pthread )
endif( )
if( "${QS_BUILD_QUICKCHECK}" )
add_executable( quickcheck "quickcheck.c" )
target_link_libraries( quickcheck quicklib db pthread )
endif( )
if( "${QS_BUILD_SSRENDERER}" )
add_executable( ssrenderer "ssrenderer.c" )
find_package( GTK2 REQUIRED )
include_directories( "${GTK2_INCLUDE_DIRS}" )
target_link_libraries( ssrenderer quicklib db "${GTK2_LIBRARIES}" )
endif( )
if( "${QS_BUILD_TESTS}" )
add_executable( test_aef "tests/aef.c" )
target_link_libraries( test_aef quicklib db pthread )
endif( )