-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
98 lines (79 loc) · 2.81 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 2.8)
project(tungsten)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
add_definitions(-DBOOST_TEST_DYN_LINK)
if(ENABLE_MULTITHREADING)
add_definitions(-DTUNGSTEN_USE_MULITTHREADING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
find_package(Boost COMPONENTS
program_options system unit_test_framework python thread)
find_package(GMP)
find_package(MPFR)
find_package(Readline)
find_package(PythonLibs)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -g -fPIC")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(src)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${GMP_INCLUDE_DIR})
include_directories(SYSTEM ${MPFR_INCLUDES})
include_directories(SYSTEM ${READLINE_INCLUDE_DIR})
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS})
aux_source_directory(src/ast SRC_AST_SOURCES)
aux_source_directory(src/eval SRC_EVAL_SOURCES)
aux_source_directory(src/eval/builtin SRC_EVAL_BUILTIN_SOURCES)
aux_source_directory(src/io SRC_IO_SOURCES)
aux_source_directory(src/io/graphics SRC_IO_GRAPHICS_SOURCES)
aux_source_directory(src/math SRC_MATH_SOURCES)
aux_source_directory(src/util SRC_UTIL_SOURCES)
aux_source_directory(ut UT_ROOT_SOURCES)
aux_source_directory(ut/ast UT_AST_SOURCES)
aux_source_directory(ut/eval UT_EVAL_SOURCES)
aux_source_directory(ut/eval/builtin UT_EVAL_BUILTIN_SOURCES)
aux_source_directory(ut/io UT_IO_SOURCES)
aux_source_directory(ut/io/graphics UT_IO_GRAPHICS_SOURCES)
aux_source_directory(ut/math UT_MATH_SOURCES)
aux_source_directory(ut/util UT_UTIL_SOURCES)
aux_source_directory(html HTML_SOURCES)
aux_source_directory(bin BIN_SOURCES)
set(SRC_SOURCES
${SRC_AST_SOURCES}
${SRC_EVAL_SOURCES}
${SRC_EVAL_BUILTIN_SOURCES}
${SRC_IO_SOURCES}
${SRC_IO_GRAPHICS_SOURCES}
${SRC_MATH_SOURCES}
${SRC_UTIL_SOURCES})
set(UT_SOURCES
${UT_ROOT_SOURCES}
${UT_AST_SOURCES}
${UT_EVAL_SOURCES}
${UT_EVAL_BUILTIN_SOURCES}
${UT_IO_SOURCES}
${UT_IO_GRAPHICS_SOURCES}
${UT_MATH_SOURCES}
${UT_UTIL_SOURCES})
add_library(tungsten_src STATIC ${SRC_SOURCES})
add_executable(tungsten ${BIN_SOURCES})
target_link_libraries(tungsten
tungsten_src
${GMP_LIBRARIES}
${MPFR_LIBRARIES}
${Boost_LIBRARIES}
${READLINE_LIBRARY})
add_executable(unitTest ${UT_SOURCES})
target_link_libraries(unitTest
tungsten_src
${GMP_LIBRARIES}
${MPFR_LIBRARIES}
${Boost_LIBRARIES}
${READLINE_LIBRARY})
add_library(pytungsten SHARED ${HTML_SOURCES})
target_link_libraries(pytungsten
tungsten_src
${GMP_LIBRARIES}
${MPFR_LIBRARIES}
${Boost_LIBRARIES}
${READLINE_LIBRARY}
${PYTHON_LIBRARIES})