Install into the target CMake root, not the host one. diff -Nrup a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2026-04-11 14:11:38.000000000 +0200 +++ b/CMakeLists.txt 2026-10-22 17:22:43.029339644 +0200 @@ -26,9 +26,9 @@ project( tde-cmake-rules ) file( GLOB_RECURSE _modules RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/modules/* ) -install( FILES ${_modules} DESTINATION ${CMAKE_ROOT}/Modules ) +install( FILES ${_modules} DESTINATION share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules ) file( GLOB_RECURSE _templates RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/templates/* ) -install( FILES ${_templates} DESTINATION ${CMAKE_ROOT}/Templates ) +install( FILES ${_templates} DESTINATION share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Templates )