cmake: allow chainloading of the toolchain file

Use path from CMAKE_CURRENT_LIST_FILE to load the cmake subscripts.
This allows the toolchain file to be chainloaded from another toolchain file.

(From OE-Core rev: 2d7597ee23b7c2adf40d77e8c35114a4d63aa854)

Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Samuli Piippo
2020-06-16 17:07:25 +03:00
committed by Richard Purdie
parent 7f7f785ed3
commit 5e208e0ff4

View File

@@ -19,7 +19,7 @@ if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
endif()
# Include the toolchain configuration subscripts
file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
file( GLOB toolchain_config_files "${CMAKE_CURRENT_LIST_FILE}.d/*.cmake" )
foreach(config ${toolchain_config_files})
include(${config})
endforeach()