From d9c8aacce38ab593ea9277976eb64ccadd7d062f Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:44:58 +0000 Subject: [PATCH] depends, refactor: Avoid hardcoding `host_prefix` in toolchain file This change allows the entire `depends/` directory to be relocatable. --- depends/Makefile | 1 - depends/toolchain.cmake.in | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index a2a9f6823e5..56eef8ee468 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -209,7 +209,6 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina -e 's|@STRIP@|$(host_STRIP)|' \ -e 's|@OBJCOPY@|$(host_OBJCOPY)|' \ -e 's|@OBJDUMP@|$(host_OBJDUMP)|' \ - -e 's|@depends_prefix@|$(host_prefix)|' \ -e 's|@CFLAGS@|$(strip $(host_CFLAGS))|' \ -e 's|@CFLAGS_RELEASE@|$(strip $(host_release_CFLAGS))|' \ -e 's|@CFLAGS_DEBUG@|$(strip $(host_debug_CFLAGS))|' \ diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 69ff3cfb74e..43f43fc30f9 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -72,12 +72,12 @@ set(CMAKE_OBJDUMP "@OBJDUMP@") # affected by a potentially random environment. set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) -set(CMAKE_FIND_ROOT_PATH "@depends_prefix@") +set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -set(QT_TRANSLATIONS_DIR "@depends_prefix@/translations") +set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE) # The find_package(Qt ...) function internally uses find_library()