-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (37 loc) · 1.2 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
cmake_minimum_required(VERSION 3.21)
project(gc-cykp)
set(CMAKE_CXX_STANDARD 17)
option(BUILD_TESTS "Ask cmake to build unit tests" OFF)
add_executable(${PROJECT_NAME})
target_sources(${PROJECT_NAME}
PRIVATE
main.cpp
src/Application.cpp
src/ArgumentParsing.cpp
PUBLIC
src/ExceptionController.cpp
src/Talker.cpp
src/Grammar.cpp
src/isInChomskyForm.cpp
src/NonterminalCompression.cpp
src/ChomskyFormConversion.cpp
src/CYK_Algorithm.cpp
src/execConversion.cpp
src/execRecognition.cpp)
target_include_directories(${PROJECT_NAME}
PUBLIC
"${PROJECT_SOURCE_DIR}/include")
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(BUILD_FLAGS "-g -DEXCEPTION_POLICY_INDEX=0")
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
set(BUILD_FLAGS "-DEXCEPTION_POLICY_INDEX=1")
endif()
target_compile_options(${PROJECT_NAME}
PUBLIC "-g") # TODO: fix BUILD_FLAGS
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
if (${BUILD_TESTS})
message("BUILD_TESTS is ON, so building tests...")
add_subdirectory("${PROJECT_SOURCE_DIR}/testing")
endif()