Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions cmake_modules/Findpagmo_IPOPT.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
10 changes: 7 additions & 3 deletions cmake_modules/PagmoFindBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
Loading