Skip to content

Commit

Permalink
Merge pull request #62 from rjfd/wip-cmake-gtest
Browse files Browse the repository at this point in the history
cmake: build gtest only if dmclock_TEST is ON

Reviewed-by: Kefu Chai <[email protected]>
Reviewed-by: Nathan Cutler <[email protected]>
  • Loading branch information
ivancich authored Aug 29, 2018
2 parents 27aa51f + d4755f5 commit 5c82208
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ project(dmclock CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")

if (NOT(TARGET gtest AND TARGET gtest_main))
if (NOT GTEST_FOUND)
find_package(GTest QUIET)
if (NOT GTEST_FOUND)
include(BuildGTest)
endif()
endif()
endif()

if (NOT(BOOST_FOUND))
find_package(Boost REQUIRED)
endif()
Expand All @@ -33,6 +24,15 @@ endif()

option(dmclock_TEST "Generate test targets" ${MASTER_PROJECT})
if(dmclock_TEST)
if (NOT(TARGET gtest AND TARGET gtest_main))
if (NOT GTEST_FOUND)
find_package(GTest QUIET)
if (NOT GTEST_FOUND)
include(BuildGTest)
endif()
endif()
endif()

enable_testing()
add_subdirectory(test)
add_subdirectory(support/test)
Expand Down

0 comments on commit 5c82208

Please sign in to comment.