-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (27 loc) · 1.02 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
cmake_minimum_required(VERSION 3.1)
project(poem-generator)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
include_directories(${PROJECT_SOURCE_DIR})
add_executable(main dictionary.cpp main.cpp entry.cpp poetic.cpp)
if(BUILD_TESTS)
include_directories(${GTEST_INCLUDE_DIRS})
set(__CFLAGS "${CMAKE_C_FLAGS}")
set(__CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
add_subdirectory(googletest EXCLUDE_FROM_ALL)
set(CMAKE_C_FLAGS "${__CFLAGS}")
set(CMAKE_CXX_FLAGS "${__CXXFLAGS}")
unset(__CFLAGS)
unset(__CXXFLAGS)
enable_testing()
add_executable(test_metaphone test_metaphone.cpp metaphone.cpp)
target_link_libraries(test_rhyme gtest gtest_main)
add_executable(test_encode test_encode.cpp metaphone.cpp)
target_link_libraries(test_encode gtest gtest_main)
add_test(TestMetaphone test_metaphone)
add_test(TestEncode test_encode)
endif()