Separate tests and tools

Don't build tests if the confusingly named YAML_CPP_BUILD_TOOLS is ON.
Instead, add a new option that controls only if the tests are built.
(Also, default tests to OFF.)
This commit is contained in:
Matthew Woehlke 2017-11-09 15:30:25 -05:00 committed by Jesse Beder
parent 3f33f337a7
commit 752804372c

View File

@ -38,7 +38,8 @@ enable_testing()
### Project options ### Project options
### ###
## Project stuff ## Project stuff
option(YAML_CPP_BUILD_TOOLS "Enable testing and parse tools" ON) option(YAML_CPP_BUILD_TESTS "Enable testing" ON)
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON)
option(YAML_CPP_BUILD_CONTRIB "Enable contrib stuff in library" ON) option(YAML_CPP_BUILD_CONTRIB "Enable contrib stuff in library" ON)
## Build options ## Build options
@ -349,8 +350,10 @@ endif()
### ###
### Extras ### Extras
### ###
if(YAML_CPP_BUILD_TOOLS) if(YAML_CPP_BUILD_TESTS)
add_subdirectory(test) add_subdirectory(test)
endif()
if(YAML_CPP_BUILD_TOOLS)
add_subdirectory(util) add_subdirectory(util)
endif() endif()