From 1156b45273d1658c7975149d36fc013f3ba96a23 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 6 Nov 2018 12:31:59 +0100 Subject: Reordering files inclusion by the module Process distro specifics cmake files before app-template To be sure that everything is set up before calling the app-templates mechanism that will search and process libraries dependencies etc. Change-Id: Icaca4cf4130e60d56d045e5a07e40163bb3c2bb5 Signed-off-by: Romain Forlot --- src/cmake/common.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cmake/common.cmake b/src/cmake/common.cmake index 6e43d13..318d98e 100644 --- a/src/cmake/common.cmake +++ b/src/cmake/common.cmake @@ -61,6 +61,7 @@ message("Distribution detected (separated by ';' choose one of them) ${OSRELEASE # Include CMake modules core files file(GLOB project_cmakefiles ${CMAKE_CURRENT_LIST_DIR}/cmake.d/[0-9][0-9]-*.cmake) +list(SORT project_cmakefiles) # Include optionnal user defined OS relative CMake files foreach(OS IN LISTS OSRELEASE) @@ -71,15 +72,13 @@ list(APPEND PATTERN "${PROJECT_CMAKE_CONF_DIR}/../cmake/[0-9][0-9]-common*.cmake "${PROJECT_CMAKE_CONF_DIR}/../cmake.d/[0-9][0-9]-common*.cmake") file(GLOB distro_cmakefiles ${PATTERN}) -list(SORT distro_cmakefiles) if(NOT distro_cmakefiles) file(GLOB distro_cmakefiles ${CMAKE_SOURCE_DIR}/${PROJECT_CMAKE_CONF_DIR}/cmake/[0-9][0-9]-default*.cmake ${CMAKE_SOURCE_DIR}/${PROJECT_CMAKE_CONF_DIR}/cmake.d/[0-9][0-9]-default*.cmake) endif() -list(APPEND project_cmakefiles "${distro_cmakefiles}") -list(SORT project_cmakefiles) +list(SORT distro_cmakefiles) file(GLOB home_cmakefiles $ENV{HOME}/.config/app-templates/cmake.d/[0-9][0-9]-common*.cmake $ENV{HOME}/.config/app-templates/cmake.d/[0-9][0-9]-${PROJECT_NAME}*.cmake @@ -97,7 +96,7 @@ file(GLOB system_cmakefiles /etc/app-templates/cmake.d/[0-9][0-9]-common*.cmake /etc/CMakeAfbTemplates/cmake.d/[0-9][0-9]-${PROJECT_NAME}*.cmake) list(SORT system_cmakefiles) -foreach(file ${system_cmakefiles} ${home_cmakefiles} ${project_cmakefiles}) +foreach(file ${system_cmakefiles} ${home_cmakefiles} ${distro_cmakefiles} ${project_cmakefiles}) message("Include: ${file}") include(${file}) endforeach() -- cgit 1.2.3-korg