Skip to content

Commit 5a7d84b

Browse files
authored
Removing tests if project is not top-level. (#143)
1 parent a8b21b5 commit 5a7d84b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ cmake_minimum_required(VERSION 3.29)
22
include(FindGit)
33
include(CMakeParseArguments)
44

5+
if (PROJECT_IS_TOP_LEVEL)
6+
include(CTest)
7+
endif()
8+
59
if(WIN32)
610
set(CMAKE_OBJECT_PATH_MAX 500)
711
endif()
812

913
project(adobe_source_libraries CXX)
10-
include(CTest)
1114

1215
# download CPM.cmake
1316
file(
@@ -36,7 +39,7 @@ endif(NOT DEFINED CMAKE_CXX_STANDARD)
3639
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
3740

3841
# Create symlink to compile_commands.json for clangd
39-
if(CMAKE_EXPORT_COMPILE_COMMANDS AND TOP_LEVEL_PROJECT)
42+
if(CMAKE_EXPORT_COMPILE_COMMANDS AND PROJECT_IS_TOP_LEVEL)
4043
add_custom_target(clangd_compile_commands ALL
4144
COMMAND ${CMAKE_COMMAND} -E create_symlink
4245
${CMAKE_BINARY_DIR}/compile_commands.json
@@ -75,7 +78,7 @@ endfunction(target_link_boost_test)
7578

7679
add_subdirectory(source)
7780

78-
if(BUILD_TESTING)
81+
if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
7982
add_subdirectory(test)
8083
endif()
8184

0 commit comments

Comments
 (0)