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

List:       kde-commits
Subject:    [kdepimlibs/frameworks] kontactinterface: Reactivate code where we need to check X11
From:       Montel Laurent <montel () kde ! org>
Date:       2014-07-04 11:29:08
Message-ID: E1X31fw-0005FU-0t () scm ! kde ! org
[Download RAW message or body]

Git commit 29226112fac5a3a0a50dd8ee523916304f6e2a98 by Montel Laurent.
Committed on 04/07/2014 at 11:28.
Pushed by mlaurent into branch 'frameworks'.

Reactivate code where we need to check X11

M  +8    -0    kontactinterface/CMakeLists.txt
A  +5    -0    kontactinterface/config-kontactinterface.h.cmake
M  +1    -1    kontactinterface/src/CMakeLists.txt
M  +3    -2    kontactinterface/src/pimuniqueapplication.cpp

http://commits.kde.org/kdepimlibs/29226112fac5a3a0a50dd8ee523916304f6e2a98

diff --git a/kontactinterface/CMakeLists.txt b/kontactinterface/CMakeLists.txt
index 2798302..2e9226e 100644
--- a/kontactinterface/CMakeLists.txt
+++ b/kontactinterface/CMakeLists.txt
@@ -34,6 +34,14 @@ ecm_setup_version(${KDEPIMLIBS_VERSION} VARIABLE_PREFIX \
KONTACTINTERFACE  find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
 find_package(KF5Parts ${KF5_VERSION} CONFIG REQUIRED)
 
+if (NOT APPLE)
+    find_package(X11)
+endif()
+
+set(KONTACTINTERFACE_HAVE_X11 ${X11_FOUND})
+configure_file(config-kontactinterface.h.cmake \
${CMAKE_CURRENT_BINARY_DIR}/config-kontactinterface.h ) +
+
 if(${CMAKE_SOURCE_DIR} STREQUAL ${KontactInterface_SOURCE_DIR})
   find_package(KF5PimUtils ${KDEPIMLIBS_VERSION} CONFIG REQUIRED)
 endif()
diff --git a/kontactinterface/config-kontactinterface.h.cmake \
b/kontactinterface/config-kontactinterface.h.cmake new file mode 100644
index 0000000..17e58b0
--- /dev/null
+++ b/kontactinterface/config-kontactinterface.h.cmake
@@ -0,0 +1,5 @@
+/* config-kontactinterface.h. Generated by cmake from \
config-kontactinterface.h.cmake */ +
+/* Define to 1 if you have the Xlib */
+#cmakedefine01 KONTACTINTERFACE_HAVE_X11
+
diff --git a/kontactinterface/src/CMakeLists.txt \
b/kontactinterface/src/CMakeLists.txt index 288ebb4..a9a1877 100644
--- a/kontactinterface/src/CMakeLists.txt
+++ b/kontactinterface/src/CMakeLists.txt
@@ -12,7 +12,7 @@ generate_export_header(KF5KontactInterface BASE_NAME \
kontactinterface)  add_library(KF5::KontactInterface ALIAS KF5KontactInterface)
 
 target_include_directories(KF5KontactInterface INTERFACE \
                "$<INSTALL_INTERFACE:${KF5_INCLUDE_INSTALL_DIR}/KontactInterface>")
-target_include_directories(KF5KontactInterface PUBLIC \
"$<BUILD_INTERFACE:${KontactInterface_SOURCE_DIR}/src;${KontactInterface_BINARY_DIR}/src>")
 +target_include_directories(KF5KontactInterface PUBLIC \
"$<BUILD_INTERFACE:${KontactInterface_SOURCE_DIR}/src;${KontactInterface_BINARY_DIR}/src;${KontactInterface_BINARY_DIR}>")
  
 target_link_libraries(KF5KontactInterface
                      PUBLIC
diff --git a/kontactinterface/src/pimuniqueapplication.cpp \
b/kontactinterface/src/pimuniqueapplication.cpp index 6bc0d26..6517816 100644
--- a/kontactinterface/src/pimuniqueapplication.cpp
+++ b/kontactinterface/src/pimuniqueapplication.cpp
@@ -19,6 +19,7 @@
    Boston, MA 02110-1301, USA.
 */
 
+#include "config-kontactinterface.h"
 #include "pimuniqueapplication.h"
 
 #include <k4aboutdata.h>
@@ -89,14 +90,14 @@ bool PimUniqueApplication::start( KUniqueApplication::StartFlags \
flags )  KCmdLineArgs::saveAppArgs( ds );
 
     QByteArray new_asn_id;
-#if defined Q_WS_X11
+#if KONTACTINTERFACE_HAVE_X11
     KStartupInfoId id;
     if ( kapp ) { // KApplication constructor unsets the env. variable
       id.initId( kapp->startupId() );
     } else {
       id = KStartupInfo::currentStartupIdEnv();
     }
-    if ( !id.none() ) {
+    if ( !id.isNull() ) {
       new_asn_id = id.id();
     }
 #endif


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

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