diff --git a/CMakeLists.txt b/CMakeLists.txt index 99826404..6160c050 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,16 @@ endif() project(Catch2 LANGUAGES CXX VERSION 3.0.0) -# Provide path for scripts +# Provide path for scripts. We first add path to the scripts we don't use, +# but projects including us might, and set the path up to parent scope. +# Then we also add path that we use to configure the project, but is of +# no use to top level projects. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/extras") +if (NOT NOT_SUBPROJECT) + set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE) +endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") + include(GNUInstallDirs) include(CMakePackageConfigHelpers) include(CatchConfigOptions)