-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
47 lines (37 loc) · 1.55 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
47
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
include(CMakePackageConfigHelpers)
project(goodform VERSION 1.0.0)
enable_testing()
add_definitions(-DBOOST_DISABLE_CURRENT_FUNCTION -DBOOST_THROW_EXCEPTION_CURRENT_FUNCTION)
#set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_COMPILER "/opt/local/bin/g++-mp-7")
#set(CMAKE_CC_COMPILER "/opt/local/bin/gcc-mp-7")
set(HEADER_FILES
include/goodform/form.hpp
include/goodform/variant.hpp
include/goodform/msgpack.hpp
include/goodform/json.hpp
include/goodform/portable_endian.hpp)
set(SOURCE_FILES
src/form.cpp
src/variant.cpp
src/msgpack.cpp
src/json.cpp
src/form.cpp)
add_library(goodform ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(goodform PRIVATE include)
target_compile_features(goodform PUBLIC cxx_auto_type cxx_lambdas)
add_executable(goodform-test src/test.cpp)
target_include_directories(goodform-test PUBLIC include)
target_link_libraries(goodform-test goodform)
add_test(example_test goodform-test example)
add_test(simple_test goodform-test simple)
install(DIRECTORY include/goodform DESTINATION include)
install(TARGETS goodform EXPORT ${PROJECT_NAME}-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(EXPORT ${PROJECT_NAME}-config DESTINATION share/${PROJECT_NAME})
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME})
export(EXPORT ${PROJECT_NAME}-config)