cmake: robustify base path in local file reference

To make the macro find this file also when used elsewhere than the root
`CMakeLists.txt`. Current code only uses it from the root.

Follow-up to 88c17d5587

Closes #22187
This commit is contained in:
Viktor Szakats 2026-06-23 20:18:26 +02:00
parent 84c5dcdb05
commit 4839029645
No known key found for this signature in database

View file

@ -43,7 +43,7 @@ macro(curl_internal_test _curl_test)
message(STATUS "Performing Test ${_curl_test}")
try_compile(${_curl_test}
${PROJECT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
"${PROJECT_SOURCE_DIR}/CMake/CurlTests.c"
COMPILE_DEFINITIONS "-D${_curl_test}" ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE CURL_TEST_OUTPUT)