musikcube/.cmake/DependencyDetection.cmake
casey langen 4f44829cda
Improve cross-compile support (#634)
* Update minimum CMake version requirement to get rid of warning.
* Include CMake compile commands for easier diagnostics.
* More improvements to arm toolchain selection while cross-compiling third-party dependencies.
* Use x-tools provided cmake toolchains
* Add a script to download and extract deb dependencies for crosscompile.
* Link against libstdc++ statically when cross-compiling to ARM to improve portability.
* Update GeneratePackage.cmake to generate better filenames.
* Ensure symbols are stripped properly when cross-compiling
* Remove old scripts that are no longer required
* Add script to install x-tools
* Add some docs that describe how to setup a crosscompile environment.
* Add docs for building standlone on Linux
* Update CHANGELOG
* Update version hash.
2023-09-07 22:05:43 -07:00

22 lines
1.1 KiB
CMake

macro(find_vendor_library target_var library_name)
find_library(${target_var} NAMES ${library_name} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH NO_CACHE)
message(STATUS "[dependency-detection] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
endmacro(find_vendor_library)
macro(find_header header_name)
set(TEMP "")
find_path(TEMP ${header_name} HINTS ${PROJECT_INCLUDE_DIRECTORIES} REQUIRED NO_CACHE)
if (${TEMP} MATCHES "TEMP-NOTFOUND")
message(STATUS "[dependency-detection] ${BoldRed}'${header_name}' COULD NOT BE FOUND!${ColorReset}")
else()
message(STATUS "[dependency-detection] ${BoldBlue}'${header_name}' resolved to '${TEMP}'${ColorReset}")
endif()
unset(TEMP)
endmacro(find_header)
macro(find_library_and_header target_var library_name header_name)
find_library(${target_var} NAMES ${library_name} NO_CACHE)
message(STATUS "[dependency-detection] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
find_header(${header_name})
endmacro(find_library_and_header)