build just the tests, as an option for autopkgtest later
authorMichael R. Crusoe <crusoe@ucdavis.edu>
Thu, 20 Dec 2018 21:34:59 +0000 (22:34 +0100)
committerAndreas Tille <tille@debian.org>
Thu, 20 Dec 2018 21:34:59 +0000 (22:34 +0100)
With assistance from Kevin D. Murray; thanks!

Gbp-Pq: Name add-only-tests-target

CMakeLists.txt

index dcb9cd677ad8bbba3b03f9ab6cd2a2a83b0847d7..52dd3df68488f0e30e861a966e6501a157796632 100644 (file)
@@ -32,6 +32,8 @@ else()
     endif()
 endif()
 
+option(ONLY_TESTS "Don't build docs, or sandbox" OFF)
+
 if(NOT CMAKE_VERSION VERSION_LESS 3.0)
     add_library(cereal INTERFACE)
     target_include_directories(cereal INTERFACE
@@ -49,18 +51,21 @@ if(JUST_INSTALL_CEREAL)
     return()
 endif()
 
-include_directories(./include)
 
 # Boost serialization for performance sandbox
 find_package(Boost COMPONENTS serialization)
 
 if(Boost_FOUND)
   include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
+  if(NOT ONLY_TEST)
+         include_directories(./include)
+  endif(NOT ONLY_TEST)
 endif(Boost_FOUND)
   
 enable_testing()
 add_subdirectory(unittests)
-
-add_subdirectory(sandbox)
+if(NOT ONLY_TEST)
+       add_subdirectory(sandbox)
+endif(NOT ONLY_TEST)
 
 add_subdirectory(doc)