-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
86 lines (64 loc) · 2.52 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required( VERSION 3.7 )
option ( CMAKE_DEBUG_OUTPUT "Enable if you want additional output for cmake's configure stage" OFF )
option ( BUILD_LIBRARY "Enable if you want to build the library (and applications)" ON )
option ( BUILD_EXAMPLES "Enable if you want to build example applications" ON )
option ( BUILD_DOCS "Enable if you want to build docs" OFF )
if ( ${CMAKE_DEBUG_OUTPUT} )
set(CMAKE_DEBUG_TARGET_PROPERTIES
INCLUDE_DIRECTORIES
COMPILE_DEFINITIONS
CONTAINER_SIZE_REQUIRED
LIB_VERSION
)
endif ()
include( "CMakeModules/CustomTargets.cmake" )
include( "CMakeModules/CustomBuildTypes.cmake" )
include( "CMakeModules/enable_cpp17.cmake" )
include( "CMakeModules/CreateVersionFile.cmake" )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/Global" )
project( OS-Matcher LANGUAGES C CXX ) # The version information is pulled from hte git tag.
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
add_compile_options( -stdlib=libc++ ) # Due to https://bugs.llvm.org/show_bug.cgi?id=33222
endif()
enable_cpp17()
add_compile_options( -Wall -Wextra )
if ( ${BUILD_LIBRARY} )
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.15/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(
REQUIRES
# Ambrosys libraries
amb-log/0.5.0@amb/stable
amb-pipeline/0.4.0@amb/stable
cli-app/0.4.0@amb/stable
# A modern, C++-native, header-only, framework for unit-tests.
catch2/2.13.6
# JSON for Modern C++.
nlohmann_json/3.9.1
# Boost C++ libraries.
boost/1.76.0
libpqxx/7.5.0
lemon/1.3.2@amb/stable
BASIC_SETUP
NO_OUTPUT_DIRS
PROFILE_AUTO
CMAKE_TARGETS
BUILD missing
)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
include_directories( ${CMAKE_BINARY_DIR}/GeneratedIncludes )
add_compile_options( -D__CMAKE_BINARY_DIR__=\"${CMAKE_BINARY_DIR}\" )
add_compile_options( -D__CMAKE_SOURCE_DIR__=\"${CMAKE_SOURCE_DIR}\" )
add_subdirectory( src )
if ( ${BUILD_EXAMPLES} )
add_subdirectory( examples )
endif ()
endif ()
if ( ${BUILD_DOCS} )
add_subdirectory( docs )
endif ()