From 88b985be5d573c4e619372a4f452b44d7ffcb205 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 Dec 2015 20:34:18 -0800 Subject: [PATCH] Allow building of tests to be disabled in cmake. Defining WITHOUT_TESTS will result in tests not being built. Fixes #38. --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4aa157b32..669c7307b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,10 +89,11 @@ INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers) # We need thread support find_package(Threads REQUIRED) -enable_testing() - -add_subdirectory(gmock) -include_directories("gmock/include") -include_directories("gmock/gtest/include") -add_subdirectory(test) +if (NOT WITHOUT_TESTS) + enable_testing() + add_subdirectory(gmock) + include_directories("gmock/include") + include_directories("gmock/gtest/include") + add_subdirectory(test) +endif()