include CPM via CMAKE_CURRENT_SOURCE_DIR

This again allows crow to be used as a CMake subproject.
This broke in #1066, as CMAKE_SOURCE_DIR refers to the directory of the
root CMakeLists.txt. And when being used from a toplevel project,
${CMAKE_SOURCE_DIR}/cmake/CPM.cmake would not refer to crow's copy of CPM.
This change makes the reference relative to the location of the
CMakeLists.txt requiring the include.
This commit is contained in:
Martin Aumüller
2025-08-22 15:02:29 +02:00
committed by gittiver
parent 2c4d92dd7c
commit 105a290536

View File

@@ -11,7 +11,7 @@ project(Crow
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(${CMAKE_SOURCE_DIR}/cmake/CPM.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake)
# Make sure Findasio.cmake module is found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)