From d3aba6033f21133f1cbefd0b564c2accd0b26147 Mon Sep 17 00:00:00 2001 From: MichaelFeistETC <145134025+MichaelFeistETC@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:54:26 -0600 Subject: [PATCH] #968 Swap PROJECT_IS_TOP_LEVEL called before project() (#1015) --- cmake/helpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake index 9249fb4e4..4624f3c2e 100644 --- a/cmake/helpers.cmake +++ b/cmake/helpers.cmake @@ -13,7 +13,7 @@ function(determine_version_with_git) git_describe(VERSION ${ARGN}) string(FIND ${VERSION} "." VALID_VERSION) if(VALID_VERSION EQUAL -1) - if(PROJECT_IS_TOP_LEVEL) + if(CMAKE_CURRENT_LIST_DIR STREQUAL PROJECT_SOURCE_DIR) # only warn if this is the top-level project, since we may be # building from a tarball as a subproject message(WARNING "Version string ${VERSION} retrieved with git describe is invalid")