From 6bd23c23c6cc62581be8f977cb676ec0c47cdd55 Mon Sep 17 00:00:00 2001 From: verbalshadow Date: Thu, 29 May 2008 02:39:00 +0000 Subject: [PATCH] Cmake: Improve Gtkmm dependency checking, add new files to CMakeLists.txts, remove old/unused files --- CMakeScripts/ConfigInkscapeDepends.cmake | 88 ------------------------ CMakeScripts/DefineDependsandFlags.cmake | 2 +- CMakeScripts/FindGC.cmake | 26 ------- CMakeScripts/FindGtkMM.cmake | 55 +++++++++------ src/2geom/CMakeLists.txt | 4 +- src/CMakeLists.txt | 2 + 6 files changed, 38 insertions(+), 139 deletions(-) delete mode 100644 CMakeScripts/ConfigInkscapeDepends.cmake delete mode 100644 CMakeScripts/FindGC.cmake diff --git a/CMakeScripts/ConfigInkscapeDepends.cmake b/CMakeScripts/ConfigInkscapeDepends.cmake deleted file mode 100644 index 94d43263b..000000000 --- a/CMakeScripts/ConfigInkscapeDepends.cmake +++ /dev/null @@ -1,88 +0,0 @@ -SET(INKSCAPE_DEPENDS -# the commented out below are required but pulled in with gtk+-2.0 & gtkmm-2.4 -# with some duplication that we can only remove if lookup each sub-lib individually -# cairo -# cairomm-1.0 -# glib-2.0 -# glibmm-2.4 - gsl - gtk+-2.0 - gtkmm-2.4 - sigc++-2.0 - lcms -# libgc1c2 - libpng - libxml-2.0 - libxslt - ImageMagick++ - freetype2) -SET(INKSCAPE_OPTIONAL - gnome-vfs-2.0 - libwpg-0.1 - libssl) - -include(UsePkgConfig) - -# Dependencies Packages -message(STATUS "") -message(STATUS "") -message(STATUS "Checking For REQUIRED Libraries for Building Inkscape.") -SET(INKSCAPE_LINK_FLAGS "") -FOREACH(dep ${INKSCAPE_DEPENDS}) - # This is a hack due to a bug in Cmake vars system, Uncomment if using a version older than 2.4 //verbalshadow -# IF("${dep}" MATCHES "gtk\\+-2.0") -# SET(dep_name "GTK2") -# ELSE("${dep}" MATCHES "gtk\\+-2.0") - SET(dep_name "${dep}") -# ENDIF("${dep}" MATCHES "gtk\\+-2.0") - - PKGCONFIG_FOUND(${dep} "${dep}_FOUND") - PKGCONFIG(${dep} "${dep_name}_INCLUDE_DIR" "${dep_name}_LINK_DIR" "${dep_name}_LINK_FLAGS" "${dep_name}_CFLAGS") -# PKGCONFIG_VERSION(${dep} "${dep}_VERSION") - IF("${dep}_FOUND") - message(STATUS "${dep}: FOUND") - # Set Compiler Flags - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${dep_name}_CFLAGS}") -# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${dep_name}_CFLAGS}") - SET(INKSCAPE_LINK_FLAGS "${INKSCAPE_LINK_FLAGS} ${${dep_name}_LINK_FLAGS}") - ELSE("${dep}_FOUND") - message(STATUS "${dep}: NOT FOUND") - ENDIF("${dep}_FOUND") -ENDFOREACH(dep) - -# Include non pkg-config dependencies: -INCLUDE(FindBoost) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${BOOST_INCLUDE_DIR} ") -INCLUDE(FindGC) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${LIBGC_INCLUDE_DIR} ") -INCLUDE(IncludeJava) -# end Dependencies - -# Optional Dependencies Packages -message(STATUS "") -message(STATUS "") -message(STATUS "Checking For OPTIONAL Libraries for Building Inkscape.") -message(STATUS "These add additional functionality to Inkscape.") -FOREACH(opt ${INKSCAPE_OPTIONAL}) - SET(opt_name "${opt}") - PKGCONFIG_FOUND(${opt} "${opt}_FOUND") - PKGCONFIG(${opt} "${opt_name}_INCLUDE_DIR" "${opt_name}_LINK_DIR" "${opt_name}_LINK_FLAGS" "${opt_name}_CFLAGS") -# PKGCONFIG_VERSION(${opt} "${opt}_VERSION") - IF("${opt}_FOUND") - message(STATUS "${opt}: FOUND") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${opt_name}_CFLAGS}") -# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${opt_name}_CFLAGS}") - SET(INKSCAPE_LINK_FLAGS "${INKSCAPE_LINK_FLAGS} ${${opt_name}_LINK_FLAGS}") - ELSE("${opt}_FOUND") - message(STATUS "${opt}: NOT FOUND") - ENDIF("${opt}_FOUND") -ENDFOREACH(opt) -# end Optional Dependencies -message(STATUS "") -message(STATUS "") - -SET(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} -j2") - -INCLUDE(ConfigCompileFlags) -INCLUDE(ConfigChecks) - diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 8a82b6214..5dbc1bf5e 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -17,7 +17,7 @@ find_package(Popt REQUIRED) find_package(OpenSSL) INCLUDE(IncludeJava) # end Dependencies - +Message(STATUS "${GTKMM_LIBRARIES}-----${GTKMM_INCLUDE_DIRS}") #Linking SET(INKSCAPE_LIBS "${GTK2_LIBRARIES}" diff --git a/CMakeScripts/FindGC.cmake b/CMakeScripts/FindGC.cmake deleted file mode 100644 index 64d9894b6..000000000 --- a/CMakeScripts/FindGC.cmake +++ /dev/null @@ -1,26 +0,0 @@ -# - Find garbage collector library -# Go hunting for garbage collector compoments -# Defines: -# LIBGC_INCLUDE_DIR - - -# To find gc on Windows, use DEVLIBS_PATH variable set by mingwenv.bat - -FIND_PATH(LIBGC_INCLUDE_DIR gc.h - /usr/include/gc - /usr/local/include/gc - $ENV{DEVLIBS_PATH}//include//gc ) - - -IF (LIBGC_INCLUDE_DIR) - SET(LIBGC_FOUND TRUE) -ENDIF (LIBGC_INCLUDE_DIR) - -IF (LIBGC_FOUND) - MESSAGE(STATUS "gc: FOUND ( ${LIBGC_INCLUDE_DIR} )") -ELSE(LIBGC_FOUND) - MESSAGE(FATAL_ERROR "gc: NOT FOUND") -ENDIF (LIBGC_FOUND) - -INCLUDE_DIRECTORIES( ${LIBGC_INCLUDE_DIR} ) - diff --git a/CMakeScripts/FindGtkMM.cmake b/CMakeScripts/FindGtkMM.cmake index 2b3f71d35..b98c19834 100644 --- a/CMakeScripts/FindGtkMM.cmake +++ b/CMakeScripts/FindGtkMM.cmake @@ -1,4 +1,5 @@ -# - Try to find GtkMM +# - Try to find GtkMM (glibmm-2.4 gdkmm-2.4 pangomm-1.4 atkmm-1.6) +# Where not going to find gtk+-2.0 as this is covered using FindGTK2 # Once done this will define # # GTKMM_FOUND - system has GtkMM @@ -12,61 +13,71 @@ # BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # - - +SET(SubLibs +gtkmm-2.4 +glibmm-2.4 +gdkmm-2.4 +pangomm-1.4 +atkmm-1.6 +) + if (GTKMM_LIBRARIES AND GTKMM_INCLUDE_DIRS) # in cache already set(GTKMM_FOUND TRUE) else (GTKMM_LIBRARIES AND GTKMM_INCLUDE_DIRS) +FOREACH(_SUBLIB ${SubLibs}) + # Clean library name for header file + STRING(REGEX REPLACE "[-]([^ ]+)" "" _H_${_SUBLIB} "${_SUBLIB}" ) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) include(UsePkgConfig) - pkgconfig(gtkmm-2.4 _GTKMM_INCLUDEDIR _GTKMM_LIBDIR _GTKMM_LDFLAGS _GTKMM_CFLAGS) + pkgconfig(${_SUBLIB} _${_SUBLIB}_INCLUDEDIR _${_SUBLIB}_LIBDIR _${_SUBLIB}_LDFLAGS _${_SUBLIB}_CFLAGS) else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_package(PkgConfig) if (PKG_CONFIG_FOUND) - pkg_check_modules(_GTKMM gtkmm-2.4) + pkg_check_modules(_${_SUBLIB} ${_SUBLIB}) endif (PKG_CONFIG_FOUND) endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_path(GTKMM_INCLUDE_DIR + find_path(${_SUBLIB}_INCLUDE_DIR NAMES - gtkmm.h + ${_H_${_SUBLIB}}.h PATHS - ${_GTKMM_INCLUDEDIR} + ${_${_SUBLIB}_INCLUDEDIR} /usr/include /usr/local/include /opt/local/include /sw/include PATH_SUFFIXES - gtkmm-2.4 + ${_SUBLIB} ) - find_library(GTKMM-2.4_LIBRARY + find_library(${_SUBLIB}_LIBRARY NAMES - gtkmm-2.4 + ${_SUBLIB} PATHS - ${_GTKMM_LIBDIR} + ${_${_SUBLIB}_LIBDIR} /usr/lib /usr/local/lib /opt/local/lib /sw/lib ) - if (GTKMM-2.4_LIBRARY) - set(GTKMM-2.4_FOUND TRUE) - endif (GTKMM-2.4_LIBRARY) + if (${_SUBLIB}_LIBRARY) + set(${_SUBLIB}_FOUND TRUE) + endif (${_SUBLIB}_LIBRARY) - set(GTKMM_INCLUDE_DIRS - ${GTKMM_INCLUDE_DIR} + LIST(APPEND GTKMM_INCLUDE_DIRS + ${${_SUBLIB}_INCLUDE_DIR} ) - if (GTKMM-2.4_FOUND) - set(GTKMM_LIBRARIES - ${GTKMM_LIBRARIES} - ${GTKMM-2.4_LIBRARY} + if (${_SUBLIB}_FOUND) + LIST(APPEND GTKMM_LIBRARIES + ${${_SUBLIB}_LIBRARIES} + ${${_SUBLIB}_LIBRARY} ) - endif (GTKMM-2.4_FOUND) + endif (${_SUBLIB}_FOUND) +ENDFOREACH(_SUBLIB) if (GTKMM_INCLUDE_DIRS AND GTKMM_LIBRARIES) set(GTKMM_FOUND TRUE) diff --git a/src/2geom/CMakeLists.txt b/src/2geom/CMakeLists.txt index fc741fb47..7150eacad 100644 --- a/src/2geom/CMakeLists.txt +++ b/src/2geom/CMakeLists.txt @@ -2,8 +2,8 @@ SET(2geom_SRC angle.h basic-intersection.cpp basic-intersection.h -bezier.h bezier-curve.h +bezier.h bezier-to-sbasis.h bezier-utils.cpp bezier-utils.h @@ -19,8 +19,8 @@ coord.h crossing.cpp crossing.h curve.h -curves.h curve-helpers.cpp +curves.h d2.h d2-sbasis.cpp d2-sbasis.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6da5168f..c2568db30 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -236,6 +236,8 @@ color-profile.h color-rgba.h composite-undo-stack-observer.cpp composite-undo-stack-observer.h +common-context.h +common-context.cpp conditions.cpp conditions.h conn-avoid-ref.cpp -- 2.30.2