diff options
author | Robert Adam <dev@robert-adam.de> | 2020-08-31 18:18:42 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-08-31 18:30:53 +0300 |
commit | fda302af9819d8391ea9972e97c9e2200bbfd520 (patch) | |
tree | f89f2dd99606c9fc47fd8454449da6078cbd719f | |
parent | 9697863c1f26731dc801d1abd291b3b2eaabe1b9 (diff) |
BUILD(cmake): Added debug-dependency-search option
If the user uses -Ddebug-dependency-search=OFF, then the find_pkg
function will not perform its searches using the QUIET flag causing a
lot of (valuable) information to be printed to the screen.
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmake/pkg-utils.cmake | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f16a72adf..695362c2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,8 @@ option(overlay "Build overlay." ON) option(packaging "Build package." OFF) option(plugins "Build plugins." ON) +option(debug-dependency-search "Prints extended information during the search for the needed dependencies" OFF) + # We support the "Debug" and "Release" configurations. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" diff --git a/cmake/pkg-utils.cmake b/cmake/pkg-utils.cmake index 02ef906cb..6676e12e6 100644 --- a/cmake/pkg-utils.cmake +++ b/cmake/pkg-utils.cmake @@ -3,7 +3,14 @@ # that can be found in the LICENSE file at the root of the # Mumble source tree or at <https://www.mumble.info/LICENSE>. -find_package(PkgConfig QUIET) +if(debug-dependency-search) + # Don't be quiet if the user wants to debug the dependency-search + set(QUIET_STR "") +else() + set(QUIET_STR "QUIET") +endif() + +find_package(PkgConfig ${QUIET_STR}) include(FindPackageMessage) @@ -15,7 +22,7 @@ function(pkgconfig_search MODULE) # We don't want pkg_search_module() to write into the variables that will be passed to the pkgconfig_search()'s caller. set(PRIVATE "PRIVATE_${MODULE}") - pkg_search_module(${PRIVATE} ${MODULE} QUIET) + pkg_search_module(${PRIVATE} ${MODULE} ${QUIET_STR}) if(NOT ${PRIVATE}_FOUND) return() @@ -67,9 +74,9 @@ macro(find_pkg ARG_ALIASES) if(FIND_PACKAGE_COMPONENTS) foreach(COMPONENT ${FIND_PACKAGE_COMPONENTS}) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) endif() if(NOT ${NAME}_FOUND) @@ -101,9 +108,9 @@ macro(find_pkg ARG_ALIASES) continue() endif() else() - find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) pkgconfig_search(${NAME}) endif() @@ -136,9 +143,9 @@ macro(find_pkg ARG_ALIASES) if(FIND_PACKAGE_OPTIONAL_COMPONENTS) foreach(COMPONENT ${FIND_PACKAGE_OPTIONAL_COMPONENTS}) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} CONFIG ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) if(NOT ${NAME}_FOUND) - find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} QUIET MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) + find_package(${NAME} COMPONENTS ${COMPONENT} ${FIND_PACKAGE_ARGUMENTS} ${QUIET_STR} MODULE ${FIND_PACKAGE_UNPARSED_ARGUMENTS}) endif() if(${NAME}_FOUND AND NOT FIND_PACKAGE_QUIET) |