Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,10 @@ function(CPMAddPackage)
"${CPM_ARGS_SYSTEM}"
"${CPM_ARGS_OPTIONS}"
)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
PARENT_SCOPE
)
set(PACKAGE_INFO "${PACKAGE_INFO} at ${download_directory}")

# As the source dir is already cached/populated, we override the call to FetchContent.
Expand Down Expand Up @@ -815,6 +819,10 @@ function(CPMAddPackage)
"${CPM_ARGS_SYSTEM}"
"${CPM_ARGS_OPTIONS}"
)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
PARENT_SCOPE
)
endif()
cpm_get_fetch_properties("${CPM_ARGS_NAME}")
endif()
Expand Down Expand Up @@ -986,6 +994,10 @@ function(
set(CPM_OLD_INDENT "${CPM_INDENT}")
set(CPM_INDENT "${CPM_INDENT} ${PACKAGE}:")
add_subdirectory(${SOURCE_DIR} ${BINARY_DIR} ${addSubdirectoryExtraArgs})
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
PARENT_SCOPE
)
set(CPM_INDENT "${CPM_OLD_INDENT}")
endif()
endfunction()
Expand Down
4 changes: 3 additions & 1 deletion examples/catch2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ target_compile_features(CPMExampleCatch2 PRIVATE cxx_std_17)

# ---- Enable testing ----

include(Catch)

enable_testing()
add_test(CPMExampleCatch2 CPMExampleCatch2)
catch_discover_tests(CPMExampleCatch2)