Problem: tests are always building

Add the ability to explicitly not build tests. Option defaults to ON to keep the current behavior, but give the user the option to disable building of tests.
This commit is contained in:
Kleis Auke Wolthuizen 2018-04-19 12:45:29 +02:00
parent 60f7753133
commit 0611afecb9

View File

@ -76,5 +76,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}/libzmq-pkg-config)
enable_testing()
add_subdirectory(tests)
option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" ON)
if (CPPZMQ_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()