Bug 372311

Summary: clang detection in FindPythonModuleGeneration.cmake only works in Debian/Ubuntu
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Antonio Rojas <arojas>
Component: generalAssignee: Alex Merry <alex.merry>
Status: CONFIRMED ---    
Severity: normal CC: ecm-bugs-null, heiko.becker, rdieter, steveire, v.dembskiy
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Antonio Rojas 2016-11-10 22:37:08 UTC
The clang detection in FindPythonModuleGeneration.cmake assumes that the clang library is called libclang-x.y.so. This is only true in Debian/ubuntu, all other major distros install the library as libclang.so.x.y. So the clang library location needs to be manually specified in these distros.
Comment 1 Rex Dieter 2017-09-13 15:32:42 UTC
confirmed (for fedora), had to manually specify:
-Dlibclang_LIBRARY:PATH=%{_libdir}/libclang.so
for rpm builds to succeed
Comment 2 Rex Dieter 2017-09-13 19:37:08 UTC
As far as I'm concerned, this simple patch works:

diff -up extra-cmake-modules-5.38.0/find-modules/FindPythonModuleGeneration.cmake.fedora extra-cmake-modules-5.38.0/find-modules/FindPythonModuleGeneration.cmake
--- extra-cmake-modules-5.38.0/find-modules/FindPythonModuleGeneration.cmake.fedora     2017-09-03 13:34:35.000000000 -0500
+++ extra-cmake-modules-5.38.0/find-modules/FindPythonModuleGeneration.cmake    2017-09-13 13:41:07.333687678 -0500
@@ -199,6 +199,9 @@ if (NOT libclang_LIBRARY)
     find_library(libclang_LIBRARY clang-3.9)
     if (NOT libclang_LIBRARY)
       find_library(libclang_LIBRARY clang-3.8)
+      if (NOT libclang_LIBRARY)
+        find_library(libclang_LIBRARY clang)
+      endif()
     endif()
   endif()
 else()
Comment 4 Christophe Marin 2017-11-05 16:54:54 UTC
*** Bug 376957 has been marked as a duplicate of this bug. ***