diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb0f3b..70b0923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ project(continuable C CXX) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + set(CONTINUABLE_UNIT_TESTS ON) +endif() + +add_subdirectory(dep) + # continuable-base add_library(continuable-base INTERFACE) @@ -52,7 +58,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) include(cmake/CMakeLists.txt) - add_subdirectory(dep) + add_subdirectory(examples) add_subdirectory(test) endif () diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 3fd7d38..d1aac53 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT TARGET gtest) +if(CONTINUABLE_UNIT_TESTS AND NOT TARGET gtest) add_subdirectory(googletest) endif()