[ 
https://issues.apache.org/jira/browse/PROTON-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538971#comment-17538971
 ] 

ASF GitHub Bot commented on PROTON-2532:
----------------------------------------

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


##########
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:
   Replaced macro with function.





> CMake find_package will fail unhelpfully when user asks for component that is 
> not provided
> ------------------------------------------------------------------------------------------
>
>                 Key: PROTON-2532
>                 URL: https://issues.apache.org/jira/browse/PROTON-2532
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: build, proton-c
>    Affects Versions: proton-c-0.37.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> {code}
> - find_package(Proton 0.34.0 REQUIRED COMPONENTS Core Proactor)
> + find_package(Proton 0.37.0 REQUIRED COMPONENTS Core Proactor Tls)
> {code}
> https://github.com/skupperproject/skupper-router/runs/5979935734?check_suite_focus=true#step:6:65
> {noformat}
> CMake Error at CMakeLists.txt:76 (find_package):
> -- Configuring incomplete, errors occurred!
> See also 
> "/tmp/skupper-rpms/skupper-router/x86_64-redhat-linux-gnu/CMakeFiles/CMakeOutput.log".
> See also 
> "/tmp/skupper-rpms/skupper-router/x86_64-redhat-linux-gnu/CMakeFiles/CMakeError.log".
>   Found package configuration file:
>     /usr/lib64/cmake/Proton/ProtonConfig.cmake
>   but it set Proton_FOUND to FALSE so package "Proton" is considered to be
>   NOT FOUND.
> error: Bad exit status from /var/tmp/rpm-tmp.01Gzla (%build)
> RPM build errors:
>     Bad exit status from /var/tmp/rpm-tmp.01Gzla (%build)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to