Skip to content

Commit 0611afe

Browse files
committed
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.
1 parent 60f7753 commit 0611afe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
7676
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake
7777
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}/libzmq-pkg-config)
7878

79-
enable_testing()
80-
add_subdirectory(tests)
79+
option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" ON)
80+
81+
if (CPPZMQ_BUILD_TESTS)
82+
enable_testing()
83+
add_subdirectory(tests)
84+
endif()

0 commit comments

Comments
 (0)