This repository has been archived by the owner on Mar 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
68 lines (53 loc) · 2.13 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
cmake_minimum_required(VERSION 3.7)
# comment out the following 2 lines to use system's default C/C++ compiler
# set(CMAKE_C_COMPILER "clang")
# set(CMAKE_CXX_COMPILER "clang++")
project(LaserPP VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
################################### LASER ###################################
include_directories(include/)
file(GLOB LASER_SOURCES
"src/formula/*.cpp"
"src/formula/extended/*.cpp"
"src/util/*.cpp"
"src/rule/*.cpp"
"src/core/*.cpp"
"src/example/*.cpp"
)
find_package(Threads)
################################## TESTAPP ##################################
include_directories(test/include/)
file(GLOB TESTAPP_SOURCES
"test/src/*.cpp"
)
set(TESTAPP_LASER_SOURCES ${LASER_SOURCES} ${TESTAPP_SOURCES})
add_executable(testapp test/main.cpp ${TESTAPP_LASER_SOURCES})
target_link_libraries(testapp ${CMAKE_THREAD_LIBS_INIT})
################################## BENCHAPP ##################################
include_directories(app_bench/include/)
file(GLOB BENCHAPP_SOURCES
"app_bench/src/*.cpp"
)
set(BENCHAPP_LASER_SOURCES ${LASER_SOURCES} ${BENCHAPP_SOURCES})
add_executable(benchapp app_bench/main.cpp ${BENCHAPP_LASER_SOURCES})
target_link_libraries(benchapp ${CMAKE_THREAD_LIBS_INIT})
################################## SIMPLEAPP ##################################
include_directories(app_simple/include/)
file(GLOB SIMPLEAPP_SOURCES
"app_simple/src/*.cpp"
)
set(SIMPLEAPP_LASER_SOURCES ${LASER_SOURCES} ${SIMPLEAPP_SOURCES})
add_executable(simpleapp app_simple/main.cpp ${SIMPLEAPP_LASER_SOURCES})
target_link_libraries(simpleapp ${CMAKE_THREAD_LIBS_INIT})
################################### TESTS ###################################
find_package(GTest)
if(GTEST_FOUND)
file(GLOB TEST_SOURCES
"test/src/*.cpp"
"test/testcase/*.cpp"
)
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(run_test test/test.cpp ${LASER_SOURCES} ${TEST_SOURCES})
target_link_libraries(run_test ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif(GTEST_FOUND)