-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
27 lines (20 loc) · 877 Bytes
/
CMakeLists.txt
File metadata and controls
27 lines (20 loc) · 877 Bytes
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
## project setup
cmake_minimum_required(VERSION 3.0)
project(csvtools)
## Add required libraries
find_package(Boost REQUIRED unit_test_framework system filesystem locale)
## Search for sources
file(GLOB_RECURSE test_sources tests/*.cpp)
## Create library
add_library(csvtools INTERFACE)
## Create executable
add_executable(csvtoolstests tests/csvtoolstests/main.cpp ${test_sources})
# Link libraries and include sources
target_include_directories(csvtools INTERFACE src ${Boost_INCLUDE_DIR})
target_link_libraries(csvtools INTERFACE ${Boost_LIBRARIES})
target_link_libraries(csvtoolstests ${Boost_LIBRARIES} csvtools)
# Configure tests
target_compile_definitions(csvtoolstests PRIVATE BOOST_TEST_DYN_LINK=1)
## add test command
enable_testing()
ADD_TEST(NAME csvtoolstests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests/csvtoolstests COMMAND csvtoolstests --log_level=all)