-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (31 loc) · 1.07 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
# Project definitions
cmake_minimum_required (VERSION 3.0)
project (midogen)
set (CMAKE_CXX_STANDARD 11)
# Vendor libraries
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS system program_options filesystem)
# Header files location
include_directories("src")
include_directories(${Boost_INCLUDE_DIRS})
# Main library: all classes implementations
file(GLOB CLASSES src/*.cpp)
list(REMOVE_ITEM CLASSES src/midogen.cpp)
add_library(MidogenLib ${CLASSES})
# Testing program
option(UNIT_TESTS "build unit tests" OFF)
if(UNIT_TESTS)
file(GLOB TEST_FILES test/*.cpp)
enable_testing()
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE "${PROJECT_SOURCE_DIR}/test")
add_executable(midogen_test ${TEST_FILES})
target_link_libraries(midogen_test Catch MidogenLib)
add_test(AllMidogenTests midogen_test)
endif()
# Main program
add_executable(midogen "src/midogen.cpp")
target_link_libraries(midogen MidogenLib
Boost::system Boost::program_options Boost::filesystem)
# Install
install (TARGETS midogen RUNTIME DESTINATION bin)