Skip to content

Commit 6e3797c

Browse files
committed
Fix CMAKE_MODULE_PATH changes are not propagated to the top-most project
This very "ugly", but sadly this is appears to be the only valid solution for ensuring top-most project is able to include cmake script modules defined by this project.
1 parent 3613f91 commit 6e3797c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ option(RSP_ENABLE_ANSI "Enable ANSI output" false)
1515
list(FIND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" has_cmake_scripts_module_path)
1616
if(has_cmake_scripts_module_path EQUAL -1)
1717
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
18+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" CACHE STRING " RSP CMake Scripts CMAKE_MODULE_PATH" FORCE)
19+
20+
message(WARNING "Caching CMAKE_MODULE_PATH. Please rebuild your project, if a failure occur.")
1821
endif()
1922

2023
# Abort if building in-source

0 commit comments

Comments
 (0)