diff --git a/cmake_modules/Findpagmo_IPOPT.cmake b/cmake_modules/Findpagmo_IPOPT.cmake index 626c33a63..cfe7bb99d 100644 --- a/cmake_modules/Findpagmo_IPOPT.cmake +++ b/cmake_modules/Findpagmo_IPOPT.cmake @@ -1,6 +1,8 @@ include(FindPackageHandleStandardArgs) -message(STATUS "Requested IPOPT components: ${pagmo_IPOPT_FIND_COMPONENTS}") +if (NOT pagmo_IPOPT_FIND_QUIETLY) + message(STATUS "Requested IPOPT components: ${pagmo_IPOPT_FIND_COMPONENTS}") +endif () # Check the components that were passed to find_package(). set(_pagmo_IPOPT_ALLOWED_COMPONENTS header libipopt) @@ -37,9 +39,11 @@ if("header" IN_LIST pagmo_IPOPT_FIND_COMPONENTS) mark_as_advanced(PAGMO_IPOPT_INCLUDE_DIR) if(pagmo_IPOPT_FOUND AND NOT TARGET pagmo::IPOPT::header) - message(STATUS "Creating the 'pagmo::IPOPT::header' imported target.") + if (NOT pagmo_IPOPT_FIND_QUIETLY) + message(STATUS "Creating the 'pagmo::IPOPT::header' imported target.") + message(STATUS "Path to the ipopt headers: ${PAGMO_IPOPT_INCLUDE_DIR}") + endif () add_library(pagmo::IPOPT::header INTERFACE IMPORTED) - message(STATUS "Path to the ipopt headers: ${PAGMO_IPOPT_INCLUDE_DIR}") set_target_properties(pagmo::IPOPT::header PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PAGMO_IPOPT_INCLUDE_DIR}") endif() endif() @@ -48,9 +52,10 @@ if ("libipopt" IN_LIST pagmo_IPOPT_FIND_COMPONENTS) mark_as_advanced(PAGMO_IPOPT_LIBRARY) if(pagmo_IPOPT_FOUND AND NOT TARGET pagmo::IPOPT::libipopt) - message(STATUS "Creating the 'pagmo::IPOPT::libipopt' imported target.") - # Otherwise, we proceed as usual. - message(STATUS "Path to libipopt: ${PAGMO_IPOPT_LIBRARY}") + if (NOT pagmo_IPOPT_FIND_QUIETLY) + message(STATUS "Creating the 'pagmo::IPOPT::libipopt' imported target.") + message(STATUS "Path to libipopt: ${PAGMO_IPOPT_LIBRARY}") + endif () add_library(pagmo::IPOPT::libipopt UNKNOWN IMPORTED) set_target_properties(pagmo::IPOPT::libipopt PROPERTIES IMPORTED_LOCATION "${PAGMO_IPOPT_LIBRARY}") endif() diff --git a/cmake_modules/PagmoFindBoost.cmake b/cmake_modules/PagmoFindBoost.cmake index 23743f7ea..433850766 100644 --- a/cmake_modules/PagmoFindBoost.cmake +++ b/cmake_modules/PagmoFindBoost.cmake @@ -10,13 +10,17 @@ if(_PAGMO_FIND_BOOST_UNIT_TEST_FRAMEWORK) list(APPEND _PAGMO_REQUIRED_BOOST_LIBS unit_test_framework) endif() -message(STATUS "Required Boost libraries: ${_PAGMO_REQUIRED_BOOST_LIBS}") +if (NOT Pagmo_FIND_QUIETLY) + message(STATUS "Required Boost libraries: ${_PAGMO_REQUIRED_BOOST_LIBS}") +endif () find_package(Boost ${_PAGMO_BOOST_MINIMUM_VERSION} REQUIRED CONFIG COMPONENTS ${_PAGMO_REQUIRED_BOOST_LIBS}) if(NOT Boost_FOUND) message(FATAL_ERROR "Not all requested Boost components were found, exiting.") endif() -message(STATUS "Detected Boost version: ${Boost_VERSION}") -message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}") +if (NOT Pagmo_FIND_QUIETLY) + message(STATUS "Detected Boost version: ${Boost_VERSION}") + message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}") +endif () # Might need to recreate targets if they are missing (e.g., older CMake versions). if(NOT TARGET Boost::boost) message(STATUS "The 'Boost::boost' target is missing, creating it.")