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:53:34 UTC

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

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


##########
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:
   Why make this a macro? It is only used once here and is repeated in the C++ config too - I'd make a macro if we could share it somehow, but we're not doing that.



##########
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@)

Review Comment:
   What does set_and_check do? I can't find any documentation for it in the cmake docs and it isn't anywhere else in the proton code.



-- 
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