Browse files

Moved finding of RSVG, Poppler-glib and GtkGl out into their own Find…

…*.cmake modules to enable easier specialization.
  • Loading branch information...
1 parent ea7eaac commit 4cf62a42db272e28e39aaaf434408db639a28900 @osg-training-guest osg-training-guest committed Nov 11, 2010
View
25 CMakeLists.txt
@@ -385,6 +385,9 @@ FIND_PACKAGE(XUL)
FIND_PACKAGE(FFmpeg)
FIND_PACKAGE(DirectShow)
FIND_PACKAGE(SDL)
+FIND_PACKAGE(Poppler-glib)
+FIND_PACKAGE(RSVG)
+FIND_PACKAGE(GtkGl)
# Include macro utilities here
INCLUDE(OsgMacroUtils)
@@ -409,28 +412,6 @@ ELSE()
ENDIF()
-#use pkg-config to find various modues
-INCLUDE(FindPkgConfig OPTIONAL)
-
-IF(PKG_CONFIG_FOUND)
-
- INCLUDE(FindPkgConfig)
-
- PKG_CHECK_MODULES(GTK gtk+-2.0)
-
- IF(WIN32)
- PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0)
- ELSE()
- PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0)
- ENDIF()
-
- PKG_CHECK_MODULES(RSVG librsvg-2.0)
- PKG_CHECK_MODULES(CAIRO cairo)
- PKG_CHECK_MODULES(POPPLER poppler-glib)
-
-ENDIF()
-
-
#optional example related dependencies
IF (BUILD_OSG_EXAMPLES)
View
2 CMakeModules/FindFLTK.cmake
@@ -1,4 +1,4 @@
-# Locate gdal
+# Locate FLTK
# This module defines
# FLTK_LIBRARY
# FLTK_FOUND, if false, do not try to link to gdal
View
16 CMakeModules/FindGtkGl.cmake
@@ -0,0 +1,16 @@
+#use pkg-config to find various modues
+INCLUDE(FindPkgConfig OPTIONAL)
+
+IF(PKG_CONFIG_FOUND)
+
+ INCLUDE(FindPkgConfig)
+
+ PKG_CHECK_MODULES(GTK gtk+-2.0)
+
+ IF(WIN32)
+ PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0)
+ ELSE()
+ PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0)
+ ENDIF()
+
+ENDIF()
View
41 CMakeModules/FindPoppler-glib.cmake
@@ -0,0 +1,41 @@
+#use pkg-config to find various modues
+INCLUDE(FindPkgConfig OPTIONAL)
+
+IF(PKG_CONFIG_FOUND)
+
+ INCLUDE(FindPkgConfig)
+
+ PKG_CHECK_MODULES(CAIRO cairo)
+ PKG_CHECK_MODULES(POPPLER poppler-glib)
+
+ IF (POPPLER_FOUND)
+
+ INCLUDE(CheckCXXSourceRuns)
+
+ SET(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIRS})
+
+ # Do step by step checking,
+ CHECK_CXX_SOURCE_RUNS("
+ #include <cstdlib>
+ #include <poppler.h>
+ int main()
+ {
+ #ifdef POPPLER_HAS_CAIRO
+ return EXIT_SUCCESS;
+ #else
+ return EXIT_FAILURE
+ #endif
+ }
+ " POPPLER_HAS_CAIRO)
+
+ IF (NOT POPPLER_HAS_CAIRO)
+ SET(POPPLER_FOUND FALSE)
+ ENDIF()
+
+ ENDIF()
+
+# IF (POPPLER_FOUND AND (NOT POPPLER_LIBRARIES OR NOT POPPLER_INCLUDE_DIRS) )
+# SET(POPPLER_FOUND FALSE)
+# ENDIF()
+
+ENDIF()
View
16 CMakeModules/FindRSVG.cmake
@@ -0,0 +1,16 @@
+#use pkg-config to find various modues
+INCLUDE(FindPkgConfig OPTIONAL)
+
+IF(PKG_CONFIG_FOUND)
+
+ INCLUDE(FindPkgConfig)
+
+ PKG_CHECK_MODULES(RSVG librsvg-2.0)
+ PKG_CHECK_MODULES(CAIRO cairo)
+
+ IF (RSVG_FOUND AND NOT CAIRO_FOUND)
+ SET(RSVG_FOUND FALSE)
+ ENDIF()
+
+
+ENDIF()
View
4 applications/present3D/CMakeLists.txt
@@ -93,10 +93,10 @@ IF (NOT DYNAMIC_OPENSCENEGRAPH)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_freetype)
ENDIF(FREETYPE_FOUND)
- IF(POPPLER_FOUND AND CAIRO_FOUND)
+ IF(POPPLER_FOUND)
ADD_DEFINITIONS(-DUSE_POPPLER_CAIRO)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_pdf)
- ENDIF(POPPLER_FOUND AND CAIRO_FOUND)
+ ENDIF(POPPLER_FOUND)
ENDIF()
IF (WIN32)
View
4 src/osgPlugins/CMakeLists.txt
@@ -234,11 +234,11 @@ IF(ZLIB_FOUND)
ADD_SUBDIRECTORY(zip)
ENDIF()
-IF(RSVG_FOUND AND CAIRO_FOUND)
+IF(RSVG_FOUND)
ADD_SUBDIRECTORY(svg)
ENDIF()
-IF(POPPLER_FOUND AND CAIRO_FOUND)
+IF(POPPLER_FOUND)
ADD_SUBDIRECTORY(pdf)
ENDIF()
View
37 src/osgPlugins/pdf/CMakeLists.txt
@@ -1,33 +1,10 @@
-INCLUDE(CheckCXXSourceRuns)
+SET(TARGET_SRC ReaderWriterPDF.cpp )
-SET(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES( ${CAIRO_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS} )
+LINK_DIRECTORIES(${CAIRO_LIBRARY_DIRS} ${POPPLER_LIBRARY_DIRS})
+SET(TARGET_EXTERNAL_LIBRARIES ${CAIRO_LIBRARIES} ${POPPLER_LIBRARIES} )
-# Do step by step checking,
-CHECK_CXX_SOURCE_RUNS("
-#include <cstdlib>
-#include <poppler.h>
-int main()
-{
-#ifdef POPPLER_HAS_CAIRO
- return EXIT_SUCCESS;
-#else
- return EXIT_FAILURE
-#endif
-}
-" POPPLER_HAS_CAIRO)
+SET(TARGET_ADDED_LIBRARIES osgWidget)
-
-IF (POPPLER_HAS_CAIRO)
-
- SET(TARGET_SRC ReaderWriterPDF.cpp )
-
- INCLUDE_DIRECTORIES( ${CAIRO_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS} )
- LINK_DIRECTORIES(${CAIRO_LIBRARY_DIRS} ${POPPLER_LIBRARY_DIRS})
- SET(TARGET_EXTERNAL_LIBRARIES ${CAIRO_LIBRARIES} ${POPPLER_LIBRARIES} )
-
- SET(TARGET_ADDED_LIBRARIES osgWidget)
-
- #### end var setup ###
- SETUP_PLUGIN(pdf pdf)
-
-ENDIF()
+#### end var setup ###
+SETUP_PLUGIN(pdf pdf)

0 comments on commit 4cf62a4

Please sign in to comment.