summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-06 12:31:59 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-11-06 20:30:35 +0100
commit1156b45273d1658c7975149d36fc013f3ba96a23 (patch)
tree939dff4ace138ed6c3d0f20da5805bc777d92ea5
parent5f06de040287a5df88d21367da9e8725d8585ba1 (diff)
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 <romain.forlot@iot.bzh>
-rw-r--r--src/cmake/common.cmake7
1 files changed, 3 insertions, 4 deletions
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()