]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/yap/CMakeLists.txt
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / yap / CMakeLists.txt
index 98a23b2f2c6df4676716f5aad6e42401e930d823..81caa3823af2c18aca9020af9334786a7265356d 100644 (file)
@@ -1,4 +1,6 @@
 cmake_minimum_required(VERSION 3.5)
+project(YAP LANGUAGES CXX)
+
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
 ################################################## 
@@ -48,6 +50,7 @@ elseif (NOT std_flag)
     message(FATAL_ERROR "Only c++14 or later will work")
 endif ()
 
+
 ##################################################
 # Sanitizers
 ##################################################
@@ -97,24 +100,39 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
     add_definitions(${std_flag} -g -Wall)
 endif ()
 
-##################################################
-# Dependencies
-##################################################
-include(dependencies)
-
 ##################################################
 # yap library
 ##################################################
 add_library(yap INTERFACE)
 target_include_directories(yap INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
 target_link_libraries(yap INTERFACE boost)
+target_compile_features(yap INTERFACE cxx_variadic_templates cxx_constexpr)
 target_compile_definitions(yap INTERFACE ${constexpr_if_define} BOOST_ALL_NO_LIB=1)
 if (link_flags)
     target_link_libraries(yap INTERFACE ${link_flags})
     target_compile_options(yap INTERFACE ${compile_flags})
 endif ()
 
-add_subdirectory(test)
-add_subdirectory(example)
-add_subdirectory(perf)
-add_subdirectory(doc) # Doesn't build docs, just the snippets files.
+macro(cond_build subdir)
+    set(SUBDIRU "")
+    string(TOUPPER ${subdir} SUBDIRU)
+    option(YAP_BUILD_${SUBDIRU} "Build ${subdir}" ON)
+    if(YAP_BUILD_${SUBDIRU})
+        add_subdirectory(${subdir})
+    endif()
+endmacro()
+
+cond_build(test)
+
+cond_build(example)
+
+if (YAP_BUILD_EXAMPLE)
+    cond_build(perf)
+endif()
+
+cond_build(doc) # Doesn't build docs, just the snippets files.
+
+##################################################
+# Dependencies
+##################################################
+include(dependencies)