Bug 372311 - clang detection in FindPythonModuleGeneration.cmake only works in Debian/Ubuntu
Summary: clang detection in FindPythonModuleGeneration.cmake only works in Debian/Ubuntu
Status: CONFIRMED
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
: 376957 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-10 22:37 UTC by Antonio Rojas
Modified: 2017-11-05 16:54 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***