Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit ff1e52c

Browse files
Fix undefined PROJECT_IS_TOP_LEVEL for cmake <3.21
1 parent aeb2a3e commit ff1e52c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ project(CmakeConfigPackageTests LANGUAGES CXX)
44

55
# ---- Test as standalone project the exported config package ----
66

7+
# This variable is set by project() in CMake 3.21+
8+
string(
9+
COMPARE EQUAL
10+
"${CMAKE_SOURCE_DIR}"
11+
"${PROJECT_SOURCE_DIR}"
12+
PROJECT_IS_TOP_LEVEL)
13+
714
if(PROJECT_IS_TOP_LEVEL OR TEST_INSTALLED_VERSION)
815
enable_testing()
916

0 commit comments

Comments
 (0)