-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
39 lines (29 loc) · 850 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
# Be verbose
set(CMAKE_VERBOSE_MAKEFILE ON)
# Prefer Clang over GCC
set(CMAKE_C_COMPILER_NAMES clang gcc icc cc)
set(CMAKE_CXX_COMPILER_NAMES clang++ g++ icpc c++ cxx)
project(common)
set(CMAKE_CXX_STANDARD 17)
# Build tests?
option(BUILD_TEST "Build the unit tests" ON)
# Search for project modules in /build-aux/
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/build-aux/")
# Helpers
if(BUILD_TEST)
include(GoogleTest)
endif()
include(LibBacktrace)
include(SQLite3)
# Interface
add_library(interface INTERFACE)
target_include_directories(interface INTERFACE include)
# Sources, it defines the library common
add_subdirectory(src obj)
add_library(libcommon INTERFACE)
target_link_libraries(libcommon INTERFACE common)
# Tests
if(BUILD_TEST)
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()