build: optionally static link boost (#2628)
This commit is contained in:
@@ -13,3 +13,31 @@ elseif(UNIX)
|
||||
include(${CMAKE_MODULE_PATH}/macros/linux.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# override find_package function
|
||||
macro(find_package) # cmake-lint: disable=C0103
|
||||
string(TOLOWER "${ARGV0}" ARGV0_LOWER)
|
||||
if(
|
||||
(("${ARGV0_LOWER}" STREQUAL "boost") AND DEFINED FETCH_CONTENT_BOOST_USED) OR
|
||||
(("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED FETCH_CONTENT_LIBEVDEV_USED)
|
||||
)
|
||||
# Do nothing, as the package has already been fetched
|
||||
else()
|
||||
# Call the original find_package function
|
||||
_find_package(${ARGV})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# override pkg_check_modules function
|
||||
macro(pkg_check_modules) # cmake-lint: disable=C0103
|
||||
string(TOLOWER "${ARGV0}" ARGV0_LOWER)
|
||||
if(
|
||||
(("${ARGV0_LOWER}" STREQUAL "boost") AND DEFINED FETCH_CONTENT_BOOST_USED) OR
|
||||
(("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED FETCH_CONTENT_LIBEVDEV_USED)
|
||||
)
|
||||
# Do nothing, as the package has already been fetched
|
||||
else()
|
||||
# Call the original pkg_check_modules function
|
||||
_pkg_check_modules(${ARGV})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user