From 742695d0946e0bf755204a5503603fd5285aa770 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 13 Nov 2018 16:29:45 +0100 Subject: Fix crosscompile installation Using CMAKE_ROOT doesn't point to the correct path when using a cross-compilation environment since the cmake installation directory isn't located in the same sysroot than the targeted system. Change-Id: If3f877c579123c5dd0b23a762c08d97755817442 Signed-off-by: Romain Forlot --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd1eb5d..ebc3824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,5 +20,7 @@ cmake_minimum_required(VERSION 3.5) include(GNUInstallDirs) -INSTALL(FILES CMakeAfbTemplates.cmake DESTINATION ${CMAKE_ROOT}/Modules) -INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION ${CMAKE_ROOT}/Modules/CMakeAfbTemplates) +get_filename_component(CMAKE_DIR ${CMAKE_ROOT} NAME) + +INSTALL(FILES CMakeAfbTemplates.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_DIR}/Modules) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_DIR}/Modules/CMakeAfbTemplates) -- cgit 1.2.3-korg