Skip to content

Commit

Permalink
build: utilize PROJECT_IS_TOP_LEVEL variable
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Jun 19, 2024
1 parent fbd7601 commit 1b2bf70
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.21)

project(
MyMkdir
Expand All @@ -8,13 +8,9 @@ project(
LANGUAGES NONE
)

if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SUBPROJECT TRUE)
endif()

include(cmake/MkdirRecursive.cmake)

if(NOT SUBPROJECT)
if(PROJECT_IS_TOP_LEVEL)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(test)
Expand Down

0 comments on commit 1b2bf70

Please sign in to comment.