[Xfce4-commits] <xfc:master> cmake cleanup, more central detection logic
Bo Lorensen
noreply at xfce.org
Sat Dec 31 15:12:01 CET 2011
Updating branch refs/heads/master
to 49ba217d73fa3b06f54143fd4cd6c3db432ff4fe (commit)
from 408a0b3493f3cfa2046d65c0bb7605fa916473b1 (commit)
commit 49ba217d73fa3b06f54143fd4cd6c3db432ff4fe
Author: Bo Lorensen <bl at lue.dk>
Date: Sat Dec 31 15:11:07 2011 +0100
cmake cleanup, more central detection logic
CMakeLists.txt | 40 +++++++++++++++++++++++++++++++++++++---
de/xfc/CMakeLists.txt | 5 -----
glade/xfc/CMakeLists.txt | 2 +-
sourceview/xfc/CMakeLists.txt | 4 +---
ui/xfc/CMakeLists.txt | 9 ++-------
ui/xfc/config.h.in | 8 +++-----
6 files changed, 44 insertions(+), 24 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d34379..b70ee15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,27 @@ PROJECT( XFC )
INCLUDE( FindPkgConfig )
+PKG_SEARCH_MODULE(GTK REQUIRED gtk+-2.0)
+PKG_SEARCH_MODULE(GTK_PRN gtk+-unix-print-2.0)
+PKG_SEARCH_MODULE(GDK REQUIRED gdk-2.0 )
+PKG_SEARCH_MODULE(SIGC REQUIRED sigc++-2.0)
+PKG_SEARCH_MODULE(PANGO REQUIRED pango)
+PKG_SEARCH_MODULE(CAIRO REQUIRED cairo)
+PKG_SEARCH_MODULE(SOURCEVIEW gtksourceview-1.0)
+PKG_SEARCH_MODULE(XFCE_PANEL libxfce4panel-1.0 )
+PKG_SEARCH_MODULE(XFCE_UTILS libxfce4util-1.0 )
+PKG_SEARCH_MODULE(XFCE_UI libxfce4ui-1 )
+PKG_SEARCH_MODULE(XFCE_CONF libxfconf-0 )
+PKG_SEARCH_MODULE(GLADE libglade-2.0)
+
+IF(DEFINED PANGO_FOUND)
+ SET(XFC_PANGO 1)
+ENDIF(DEFINED PANGO_FOUND)
+
+IF(DEFINED CAIRO_FOUND)
+ SET(XFC_CAIRO 1)
+ENDIF(DEFINED CAIRO_FOUND)
+
SET( XFC_MAJOR_VERSION 4 )
SET( XFC_MINOR_VERSION 6 )
SET( XFC_MICRO_VERSION 0 )
@@ -14,9 +35,22 @@ SET( XFCEDIR xfce4 )
ADD_SUBDIRECTORY( core )
ADD_SUBDIRECTORY( ui )
-ADD_SUBDIRECTORY( glade )
-ADD_SUBDIRECTORY( de )
-ADD_SUBDIRECTORY( sourceview )
+
+IF(DEFINED GLADE_FOUND)
+ SET(XFC_GLADE 1)
+ ADD_SUBDIRECTORY( glade )
+ENDIF(DEFINED GLADE_FOUND)
+
+IF(DEFINED XFCE_UI_FOUND)
+ SET(XFC_DE 1)
+ ADD_SUBDIRECTORY( de )
+ENDIF(DEFINED XFCE_UI_FOUND)
+
+IF(DEFINED SOURCEVIEW_FOUND)
+ SET( XFC_SOURCEVIEW 1 )
+ ADD_SUBDIRECTORY( sourceview )
+ENDIF(DEFINED SOURCEVIEW_FOUND)
+
ADD_SUBDIRECTORY( demos )
ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( docs )
diff --git a/de/xfc/CMakeLists.txt b/de/xfc/CMakeLists.txt
index 8c0e5ab..f323006 100644
--- a/de/xfc/CMakeLists.txt
+++ b/de/xfc/CMakeLists.txt
@@ -2,11 +2,6 @@
#ADD_SUBDIRECTORY( panel )
ADD_SUBDIRECTORY( utils )
-pkg_search_module( XFCE_PANEL REQUIRED libxfce4panel-1.0 )
-pkg_search_module( XFCE_UTILS REQUIRED libxfce4util-1.0 )
-pkg_search_module( XFCE_UI REQUIRED libxfce4ui-1 )
-pkg_search_module( XFCE_CONF REQUIRED libxfconf-0 )
-
INCLUDE_DIRECTORIES( ${XFCE_UTILS_INCLUDE_DIRS} ${XFCE_CONF_INCLUDE_DIRS} ${XFCE_UI_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( ${XFC_DE_SOURCE_DIR} ${XFC_CORE_SOURCE_DIR} ${SIGC_INCLUDE_DIRS} ${XFCE_CONF_INCLUDE_DIRS} ${XFCE_UTIL_INCLUDE_DIRS})
diff --git a/glade/xfc/CMakeLists.txt b/glade/xfc/CMakeLists.txt
index 0096bbb..b8bac07 100644
--- a/glade/xfc/CMakeLists.txt
+++ b/glade/xfc/CMakeLists.txt
@@ -1,6 +1,6 @@
## libXFCglade source directory
-pkg_search_module( GLADE REQUIRED libglade-2.0)
+
ADD_SUBDIRECTORY( glade )
diff --git a/sourceview/xfc/CMakeLists.txt b/sourceview/xfc/CMakeLists.txt
index 8d6ad0c..0ba65d6 100644
--- a/sourceview/xfc/CMakeLists.txt
+++ b/sourceview/xfc/CMakeLists.txt
@@ -1,11 +1,9 @@
## libXFCsourceview source directory
-pkg_search_module( SOURCEVIEW REQUIRED gtksourceview-1.0)
-
ADD_SUBDIRECTORY( sourceview )
INCLUDE_DIRECTORIES( ${SOURCEVIEW_INCLUDE_DIRS} ${XFC_CORE_SOURCE_DIR} ${XFC_UI_SOURCE_DIR}
- ${SIGC_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${XFC_SOURCEVIEW_SOURCE_DIR} )
+ ${SIGC_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${XFC_SOURCEVIEW_SOURCE_DIR} )
ADD_LIBRARY( xfc_sourceview SHARED ${sourceview_src})
diff --git a/ui/xfc/CMakeLists.txt b/ui/xfc/CMakeLists.txt
index 319bbcd..37e5d0e 100644
--- a/ui/xfc/CMakeLists.txt
+++ b/ui/xfc/CMakeLists.txt
@@ -1,10 +1,3 @@
-pkg_search_module( GTK REQUIRED gtk+-2.0)
-pkg_search_module( GTK_PRN REQUIRED gtk+-unix-print-2.0)
-pkg_search_module( GDK REQUIRED gdk-2.0 )
-pkg_search_module( SIGC REQUIRED sigc++-2.0)
-pkg_search_module( PANGO REQUIRED pango)
-pkg_search_module( CAIRO REQUIRED cairo)
-
INCLUDE_DIRECTORIES( ${GLIB_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GDK_INCLUDE_DIRS} ${GTK_PRN_INCLUDE_DIRS} ${SIGC_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( ${PANGO_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${XFC_CORE_SOURCE_DIR} ${XFC_UI_SOURCE_DIR} )
@@ -22,6 +15,8 @@ ADD_LIBRARY( xfc_ui SHARED main.cc ${src})
TARGET_LINK_LIBRARIES( xfc_ui xfc_core ${GTK_LIBRARIES} )
SET_TARGET_PROPERTIES( xfc_ui PROPERTIES VERSION ${XFC_VERSION} SOVERSION ${XFC_MAJOR_VERSION} )
+CONFIGURE_FILE( config.h.in config.h )
+
INSTALL(TARGETS xfc_ui
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib )
diff --git a/ui/xfc/config.h.in b/ui/xfc/config.h.in
index b785f3f..75ff3bd 100644
--- a/ui/xfc/config.h.in
+++ b/ui/xfc/config.h.in
@@ -1,10 +1,8 @@
#ifndef XFC_CONFIG_H
#define XFC_CONFIG_H
-#undef XFC_CAIRO
-
-#undef XFC_PANGO
-
-#undef XFC_SOURCEVIEW
+#cmakedefine XFC_CAIRO
+#cmakedefine XFC_PANGO
+#cmakedefine XFC_SOURCEVIEW
#endif
More information about the Xfce4-commits
mailing list