2017-11-15 01:23:51 +01:00
|
|
|
cmake_minimum_required(VERSION 3.5.0)
|
|
|
|
|
|
|
|
|
|
project(prjxray)
|
2018-01-09 21:26:14 +01:00
|
|
|
option(PRJXRAY_BUILD_TESTING "" OFF)
|
2017-11-15 01:23:51 +01:00
|
|
|
|
2019-10-08 12:34:00 +02:00
|
|
|
# Add sanitizers-cmake package
|
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH})
|
|
|
|
|
find_package(Sanitizers)
|
2018-01-09 21:27:14 +01:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
|
FORCE)
|
|
|
|
|
endif()
|
|
|
|
|
|
2017-11-15 02:45:11 +01:00
|
|
|
# Hack for missing option in cctz
|
|
|
|
|
option(BUILD_TESTING "" OFF)
|
|
|
|
|
|
2017-11-17 10:20:12 +01:00
|
|
|
if(PRJXRAY_BUILD_TESTING)
|
|
|
|
|
enable_testing()
|
|
|
|
|
endif()
|
|
|
|
|
|
2017-11-16 00:13:59 +01:00
|
|
|
add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(third_party/gflags EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(third_party/cctz EXCLUDE_FROM_ALL)
|
|
|
|
|
add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)
|
2017-11-15 02:45:11 +01:00
|
|
|
|
2019-10-15 06:33:23 +02:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-Wundefined-var-template" CXX_COMPILER_SUPPORTS_UNDEF_VAR)
|
|
|
|
|
if(${CXX_COMPILER_SUPPORTS_UNDEF_VAR})
|
|
|
|
|
add_compile_options("-Wno-undefined-var-template")
|
|
|
|
|
endif()
|
|
|
|
|
|
2017-12-13 21:30:30 +01:00
|
|
|
option(YAML_CPP_BUILD_TESTS "" OFF)
|
|
|
|
|
add_subdirectory(third_party/yaml-cpp EXCLUDE_FROM_ALL)
|
|
|
|
|
target_include_directories(yaml-cpp PUBLIC
|
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/yaml-cpp/include>
|
|
|
|
|
)
|
|
|
|
|
|
2018-09-27 12:19:02 +02:00
|
|
|
add_compile_options(-Wall -Werror)
|
|
|
|
|
|
2017-11-17 10:20:12 +01:00
|
|
|
add_subdirectory(lib)
|
2017-11-15 01:23:51 +01:00
|
|
|
add_subdirectory(tools)
|