From f1ec29ec86f6ef34f30d4ef738b68f71663da467 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 12 Jun 2022 16:23:32 -0400 Subject: [PATCH] Build Tweak --- cmake/base-toolchain.cmake | 10 +++++++--- docs/BUILDING.md | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/base-toolchain.cmake b/cmake/base-toolchain.cmake index 131d92287..e04dd765b 100644 --- a/cmake/base-toolchain.cmake +++ b/cmake/base-toolchain.cmake @@ -3,9 +3,13 @@ macro(setup_toolchain target) # Use ARM Cross-Compiler set(CMAKE_C_COMPILER "${target}-gcc") set(CMAKE_CXX_COMPILER "${target}-g++") - set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}") # Extra set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - # pkg-config - set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig") + # Custom Search Paths + if(NOT DEFINED ENV{MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS}) + # Find Root + set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}") + # pkg-config + set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig") + endif() endmacro() diff --git a/docs/BUILDING.md b/docs/BUILDING.md index a9227d626..4a00904f2 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -32,3 +32,6 @@ ./scripts/setup.sh ./scripts/build.sh ``` + +### Environment Variables +- ``MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS``: Use Default CMake Search Paths Rather Than Guessing