cmake: include external toolchain directory in CMAKE_FIND_ROOT_PATH (fixes #19074)
authorFelix Fietkau <nbd@openwrt.org>
Mon, 16 Mar 2015 07:51:45 +0000 (07:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 16 Mar 2015 07:51:45 +0000 (07:51 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 44825

include/cmake.mk

index 862a6a9b3f5de29e407b87e82e7b3523eece393a..c1fd7d9e51d9c2256df0be3d0d5b8b5ca3825dd5 100644 (file)
@@ -31,6 +31,8 @@ CMAKE_AR:=$(call cmake_tool,$(TARGET_AR))
 CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
 CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
 
+CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR);$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
+
 define Build/Configure/Default
        (cd $(PKG_BUILD_DIR); \
                CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
@@ -53,7 +55,7 @@ define Build/Configure/Default
                        -DCMAKE_AR="$(CMAKE_AR)" \
                        -DCMAKE_NM="$(CMAKE_NM)" \
                        -DCMAKE_RANLIB="$(CMAKE_RANLIB)" \
-                       -DCMAKE_FIND_ROOT_PATH="$(STAGING_DIR);$(TOOLCHAIN_DIR)" \
+                       -DCMAKE_FIND_ROOT_PATH="$(CMAKE_FIND_ROOT_PATH)" \
                        -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
                        -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
                        -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \