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

List:       kde-frameworks-devel
Subject:    [PATCH] Fail early if libsm is not installed
From:       Aurélien_Gâteau <agateau () kde ! org>
Date:       2013-12-19 17:10:11
Message-ID: 7049465.DZCCyytiNO () trinity
[Download RAW message or body]

Hi,

Attached patch causes cmake to fail early if libsm is not installed, rather 
than waiting until we try to build code using it.

This patch also removes buggy calls to set_package_properties(). I found
out calling set_package_properties() with something which is not a
package as the first argument is currently silently ignored. Note that
this means the TYPE argument is ignored as well, so marking something as
REQUIRED has no effect.

As a result I put together a poor-man feature_summary() implementation
at the end of the CMakeLists.txt for X11 components. It's a bit overkill
for the needs of kde4support, but can be duplicated or factorized
later.

Aurélien

["0001-Fail-early-if-libsm-is-not-installed.patch" (0001-Fail-early-if-libsm-is-not-installed.patch)]

From 03f64b79f93336b02e9afcd5aacc595395d938f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurélien Gâteau?= <agateau@kde.org>
Date: Thu, 19 Dec 2013 17:52:24 +0100
Subject: [PATCH] Fail early if libsm is not installed

Also removes buggy calls to set_package_properties() because calling
set_package_properties() with something which is not a package as the first
argument is currently silently ignored.
---
 CMakeLists.txt | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5654fa0..02ba308 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,21 +51,14 @@ else()
     include(${CMAKE_SOURCE_DIR}/tier3/kdesignerplugin/KF5DesignerPluginMacros.cmake)
 endif()

-# find_package(Strigi 0.6.3 QUIET)
-set_package_properties(Strigi PROPERTIES DESCRIPTION "Desktop indexing and search support"
-                       URL "http://strigi.sourceforge.net"
-                       TYPE OPTIONAL
-                       PURPOSE ""
-                      )
-
 find_package(X11)
+set(REQUIRED_X11_COMPONENTS "SM")
+set(RECOMMENDED_X11_COMPONENTS "Xrender")
 set(HAVE_X11 ${X11_FOUND})
 if(X11_FOUND)
-    set_package_properties(X11_Xrender PROPERTIES DESCRIPTION "X Rendering Extension (libXrender)"
-                           URL "http://www.x.org" TYPE RECOMMENDED
-                           PURPOSE "Support for compositing, rendering operations, and alpha-blending")
     set(HAVE_XRENDER ${X11_Xrender_FOUND})
 endif()
+
 if (APPLE)
    find_package(Carbon REQUIRED)
 endif ()
@@ -161,4 +154,31 @@ install( EXPORT KF5KDE4SupportTargets DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAM

 if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
   feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
+  if (X11_FOUND)
+    message(STATUS "REQUIRED X11 components:\n")
+    foreach(name ${REQUIRED_X11_COMPONENTS})
+      if (${X11_${name}_FOUND})
+        message(" * ${name}: found")
+      else()
+        message(" * ${name}: not found")
+        set(missing_required_x11_components TRUE)
+      endif()
+    endforeach()
+    message("")
+
+    message(STATUS "Recommended X11 components:\n")
+    foreach(name ${RECOMMENDED_X11_COMPONENTS})
+      if (${X11_${name}_FOUND})
+        message(" * ${name}: found")
+      else()
+        message(" * ${name}: not found")
+      endif()
+    endforeach()
+    message("")
+
+    if (missing_required_x11_components)
+      message(FATAL_ERROR "Error: some REQUIRED X11 component(s) are missing.")
+    endif()
+  endif()
 endif()
--
1.8.3.2



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

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