You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2022/05/18 13:59:54 UTC

[GitHub] [qpid-proton] jiridanek commented on a diff in pull request #371: PROTON-2532 Print STATUS when CMake `find_package` user asks for component that is not provided

jiridanek commented on code in PR #371:
URL: https://github.com/apache/qpid-proton/pull/371#discussion_r875934010


##########
c/src/ProtonConfig.cmake.in:
##########
@@ -52,26 +52,38 @@ if (Proton_USE_STATIC_LIBS)
     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_OLD})
 endif()
 
-set (Proton_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
+set_and_check (Proton_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
 set (Proton_LIBRARIES Proton::qpid-proton)
 set (Proton_FOUND True)
 
-set (Proton_Core_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
+set_and_check (Proton_Core_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
 set (Proton_Core_LIBRARIES Proton::core)
 set (Proton_Core_FOUND True)
 
 set (HAS_PROACTOR @HAS_PROACTOR@)
 if (HAS_PROACTOR)
-  set (Proton_Proactor_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
+  set_and_check (Proton_Proactor_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
   set (Proton_Proactor_LIBRARIES Proton::proactor)
   set (Proton_Proactor_FOUND True)
 endif()
 
 set (HAS_TLS @HAS_TLS@)
 if (HAS_TLS)
-  set (Proton_Tls_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
+  set_and_check (Proton_Tls_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
   set (Proton_Tls_LIBRARIES Proton::tls)
   set (Proton_Tls_FOUND True)
 endif()
 
-check_required_components(Proton)
+macro(pn_check_required_components _NAME)
+  check_required_components(${_NAME})
+
+  if (NOT ${_NAME}_FIND_QUIETLY)
+    foreach(comp ${${_NAME}_FIND_COMPONENTS})
+      if(NOT ${_NAME}_${comp}_FOUND)
+        MESSAGE(STATUS "Requested ${_NAME} component ${comp} is NOT FOUND")
+      endif()
+    endforeach()
+  endif()
+endmacro()

Review Comment:
   To give it a name and to show it belongs with check_required_components.
   
   I hoped I'll be able to find a way to share this, but then could not come up with a reasonable way (that would not entangle the c and cpp libs in a weird way).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org