-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
26 lines (21 loc) · 832 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(eightwords)
option(BUILD_TEST "Build test program" OFF)
find_package(Threads REQUIRED)
find_package(Iconv REQUIRED)
file(GLOB LIB_SRCS ./src/*.cpp)
add_library(eightwords STATIC ${LIB_SRCS})
target_compile_features(eightwords PUBLIC cxx_std_11)
target_include_directories(eightwords PUBLIC ./include)
target_link_libraries(eightwords PUBLIC Iconv::Iconv)
if(BUILD_TEST)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
enable_testing()
file(GLOB TEST_SRCS ./test/*.cpp)
add_executable(eightwords_test ${TEST_SRCS})
target_link_libraries(
eightwords_test PRIVATE eightwords Threads::Threads
unofficial::sqlite3::sqlite3 GTest::gtest_main)
add_test(NAME eightwords_test COMMAND eightwords_test)
endif()