[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    extra-cmake-modules and FindPythonModuleGeneration
From:       David Faure <faure () kde ! org>
Date:       2016-11-05 10:01:14
Message-ID: 21743110.6jGqcY92eB () asterixp50
[Download RAW message or body]

Problem 1: "make test" now requires cmake 3.3, which the CI doesn't have (it has \
3.2.2) https://build.kde.org/view/Frameworks%20kf5-qt5/job/extra-cmake-modules%20maste \
r%20kf5-qt5/36/PLATFORM=Linux,compiler=gcc/testReport/junit/(root)/TestSuite/GenerateSipBindings/
 What is required, from cmake 3.3?

Problem 2: on my own machine I get "Could not find libclang version 3.8"
even though I have /usr/lib64/libclang.so pointing to libclang.so.3.8

The problem is that FindPythonModuleGeneration.cmake says
   find_library(libclang_LIBRARY clang-3.${_LIBCLANG3_FIND_VERSION})
so it's expecting a libclang-3.8.so ? That's not the way it appears to be named on \
OpenSUSE.

I tried to fix that with (before the rest of the libclang-related code)
+if (NOT libclang_LIBRARY)
+  find_library(libclang_LIBRARY clang)
+endif()
and that works, but of course no version checks there.
Still, can I commit that?

Problem 3: It requires PyQt.
Can we make "make test" skip the test, rather than fail, if PyQt
isn't installed? Maybe like in the attached patch?

-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5


["skip_if_pyqt_not_found.diff" (skip_if_pyqt_not_found.diff)]

diff --git i/tests/CMakeLists.txt w/tests/CMakeLists.txt
index 53008e1..755b0f0 100644
--- i/tests/CMakeLists.txt
+++ w/tests/CMakeLists.txt
@@ -81,21 +81,31 @@ endmacro()
 
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/find-modules)
 
-find_package(PythonModuleGeneration)
-
-foreach(pyversion 2 3)
-  if (GPB_PYTHON${pyversion}_COMMAND)
-    if (pythonCommands)
-      list(APPEND pythonCommands " && ")
-    endif()
-    set(pythonCommands
-      ${GPB_PYTHON${pyversion}_COMMAND}
-      "${CMAKE_CURRENT_SOURCE_DIR}/GenerateSipBindings/testscript.py"
-      "${CMAKE_CURRENT_BINARY_DIR}/GenerateSipBindings/py${pyversion}"
-    )
-  endif()
-endforeach()
-add_test_macro(GenerateSipBindings ${pythonCommands})
+# Skip if PyQt not available
+find_file(SIP_Qt5Core_Mod_FILE
+    NAMES QtCoremod.sip
+    PATH_SUFFIXES share/sip/PyQt5/QtCore
+)
+
+if(NOT SIP_Qt5Core_Mod_FILE)
+    message(STATUS "WARNING: skipping tests that require PyQt")
+else()
+    find_package(PythonModuleGeneration)
+
+    foreach(pyversion 2 3)
+        if (GPB_PYTHON${pyversion}_COMMAND)
+            if (pythonCommands)
+                list(APPEND pythonCommands " && ")
+            endif()
+            set(pythonCommands
+                ${GPB_PYTHON${pyversion}_COMMAND}
+                "${CMAKE_CURRENT_SOURCE_DIR}/GenerateSipBindings/testscript.py"
+                "${CMAKE_CURRENT_BINARY_DIR}/GenerateSipBindings/py${pyversion}"
+            )
+       endif()
+   endforeach()
+   add_test_macro(GenerateSipBindings ${pythonCommands})
+endif()
 
 add_test_macro(ExecuteCoreModules dummy)
 add_test_macro(ExecuteKDEModules dummy)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic