-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
46 lines (35 loc) · 1.29 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
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(mmtf-cpp VERSION 1.0.0 LANGUAGES CXX)
option(mmtf_build_local "Use the submodule dependencies for building" OFF)
option(mmtf_build_examples "Build the examples" OFF)
add_library(MMTFcpp INTERFACE)
target_compile_features(MMTFcpp INTERFACE cxx_auto_type)
target_include_directories(MMTFcpp INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
if (mmtf_build_local)
# use header only
set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/msgpack-c/include)
add_library(msgpackc INTERFACE)
target_include_directories(msgpackc INTERFACE ${MSGPACKC_INCLUDE_DIR})
if (BUILD_TESTS)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/Catch2/single_include)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
endif()
endif()
if (NOT TARGET msgpackc)
find_package(msgpack)
endif()
target_link_libraries(MMTFcpp INTERFACE msgpackc)
if (BUILD_TESTS)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
endif()
if (mmtf_build_examples)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples)
endif()
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION "include"
FILES_MATCHING PATTERN "*.hpp")