Search for host-tools path 1356/head
authorAndrew Cook <ariscop@gmail.com>
Fri, 15 Feb 2019 01:33:13 +0000 (12:33 +1100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 17 Aug 2019 15:39:44 +0000 (17:39 +0200)
Allows source-relative paths

sdk/cmake/host-tools.cmake

index 41b82d2..04e58f7 100644 (file)
@@ -48,7 +48,12 @@ function(setup_host_tools)
     if(WITH_HOST_TOOLS)
         # Use pre-built tools, required for cross compiling with msvc
         # as only one target architecture is available at a time
     if(WITH_HOST_TOOLS)
         # Use pre-built tools, required for cross compiling with msvc
         # as only one target architecture is available at a time
-        set(HOST_TOOLS_DIR ${WITH_HOST_TOOLS})
+        find_path(HOST_TOOLS_DIR
+            NAMES ImportExecutables.cmake
+            HINTS ${WITH_HOST_TOOLS} ${REACTOS_SOURCE_DIR}/${WITH_HOST_TOOLS}
+            NO_CMAKE_PATH
+            NO_CMAKE_ENVIRONMENT_PATH)
+        message(STATUS "Using prebuilt host tools: ${HOST_TOOLS_DIR}")
         include(${HOST_TOOLS_DIR}/ImportExecutables.cmake)
     else()
         # Build host-tools. Changes to tool sources will rebuild targets
         include(${HOST_TOOLS_DIR}/ImportExecutables.cmake)
     else()
         # Build host-tools. Changes to tool sources will rebuild targets