From 1e11aff7b992e43eb370f72e3292068cde7ae4da Mon Sep 17 00:00:00 2001 From: Kai Szuttor <2150555+KaiSzuttor@users.noreply.github.com> Date: Fri, 25 Nov 2022 16:59:08 +0100 Subject: [PATCH] Only build tests if top level project (#639) --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95b86b61..e571357f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,9 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/etl DESTINATION include) -endif() - -if (BUILD_TESTS) - enable_testing() - add_subdirectory(test) + + if (BUILD_TESTS) + enable_testing() + add_subdirectory(test) + endif() endif()