The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16028 
====================================================================== 
Reported By:                David Wagner
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16028
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-03-22 06:54 EDT
Last Modified:              2016-03-22 06:54 EDT
====================================================================== 
Summary:                    find_dependency not looking for the correct FOUND
variable
Description: 
find_package(Xyz) may set either XYZ_FOUND (the default) or Xyz_FOUND (if
overriden by the called) but find_dependency will only look for Xyz_FOUND.

This means that calling, for instance, "find_dependency(LibXml2)" will always
fail because upon finding the package, the LIBXML2_FOUND variable is set.

See a patch below. If you'd prefer, I can submit it on github.

--- /usr/share/cmake-3.2/Modules/CMakeFindDependencyMacro.cmake 2015-04-13
19:09:00.000000000 +0200
+++ cmake/CMakeFindDependencyMacro.cmake        2016-03-22 11:24:08.959963959
+0100
@@ -72,7 +72,8 @@
       set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE)
     endif()
 
-    if (NOT ${dep}_FOUND)
+    string(TOUPPER ${dep} DEP)
+    if (NOT ${DEP}_FOUND AND NOT ${dep}_FOUND)
       set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
"${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could
not be found.")
       set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
       return()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-03-22 06:54 David Wagner   New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to