From 26127d370fcaac55880cfde4598d5dcf3febef54 Mon Sep 17 00:00:00 2001 From: verbalshadow Date: Wed, 7 Jan 2009 21:59:22 +0000 Subject: [PATCH] Cmake: more fixes plus a patch for OSX paths by Henrik Gustafsson --- CMakeScripts/DefineDependsandFlags.cmake | 126 +++++++++++------------ CMakeScripts/FindGDKMM.cmake | 2 + CMakeScripts/FindGIOMM.cmake | 1 + CMakeScripts/FindGLIBMM.cmake | 2 + CMakeScripts/FindGTK2.cmake | 8 ++ CMakeScripts/FindGtkMM.cmake | 3 +- CMakeScripts/FindSigC++.cmake | 1 + src/2geom/CMakeLists.txt | 41 -------- 8 files changed, 79 insertions(+), 105 deletions(-) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 19cb012de..b2d3943df 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -1,63 +1,63 @@ - -# Include dependencies: -find_package(GTK2 REQUIRED) -find_package(GtkMM REQUIRED) -find_package(SigC++ REQUIRED) -find_package(XML2 REQUIRED) -find_package(XSLT REQUIRED) -find_package(GSL REQUIRED) -find_package(ImageMagick++ REQUIRED) -find_package(Freetype2 REQUIRED) -find_package(GnomeVFS2) -find_package(Boost REQUIRED) -find_package(BoehmGC REQUIRED) -find_package(LibWPG) -find_package(PNG REQUIRED) -find_package(Popt REQUIRED) -find_package(OpenSSL) -INCLUDE(IncludeJava) -# end Dependencies - -#Linking -LIST(APPEND INKSCAPE_LIBS -${GTK2_LIBRARIES} -${GTKMM_LIBRARIES} -${SIGC++_LIBRARIES} -${GSL_LIBRARIES} -${XML2_LIBRARIES} -${XSLT_LIBRARIES} -${IMAGEMAGICK++_LIBRARIES} -${FREETYPE2_LIBRARIES} -${GNOMEVFS2_LIBRARIES} -${BOOST_LIBRARIES} -${BOEHMGC_LIBRARIES} -${PNG_LIBRARIES} -${POPT_LIBRARIES} -${OPENSSL_LIBRARIES} -) - -#Includes -SET(INK_INCLUDES -${CMAKE_BINARY_DIR} -${PROJECT_SOURCE_DIR} -${PROJECT_SOURCE_DIR}/src -${GTK2_INCLUDE_DIRS} -${GTKMM_INCLUDE_DIRS} -${SIGC++_INCLUDE_DIRS} -${GSL_INCLUDE_DIRS} -${XML2_INCLUDE_DIRS} -${XSLT_INCLUDE_DIRS} -${IMAGEMAGICK++_INCLUDE_DIRS} -${FREETYPE2_INCLUDE_DIRS} -${GNOMEVFS2_INCLUDE_DIRS} -${BOOST_INCLUDE_DIRS} -${BOEHMGC_INCLUDE_DIRS} -${PNG_INCLUDE_DIRS} -${POPT_INCLUDE_DIRS} -${OPENSSL_INCLUDE_DIRS} -) -#C/C++ Flags -INCLUDE_DIRECTORIES(${INK_INCLUDES}) - -#INCLUDE(ConfigCompileFlags) -INCLUDE(ConfigChecks) + +# Include dependencies: +find_package(GTK2 REQUIRED) +find_package(GtkMM REQUIRED) +find_package(SigC++ REQUIRED) +find_package(XML2 REQUIRED) +find_package(XSLT REQUIRED) +find_package(GSL REQUIRED) +find_package(ImageMagick++ REQUIRED) +find_package(Freetype2 REQUIRED) +find_package(GnomeVFS2) +find_package(Boost REQUIRED) +find_package(BoehmGC REQUIRED) +find_package(LibWPG) +find_package(PNG REQUIRED) +find_package(Popt REQUIRED) +find_package(OpenSSL) +INCLUDE(IncludeJava) +# end Dependencies + +#Linking +LIST(APPEND INKSCAPE_LIBS +${GTK2_LIBRARIES} +${GTKMM_LIBRARIES} +${SIGC++_LIBRARIES} +${GSL_LIBRARIES} +${XML2_LIBRARIES} +${XSLT_LIBRARIES} +${IMAGEMAGICK++_LIBRARIES} +${FREETYPE2_LIBRARIES} +${GNOMEVFS2_LIBRARIES} +${BOOST_LIBRARIES} +${BOEHMGC_LIBRARIES} +${PNG_LIBRARIES} +${POPT_LIBRARIES} +${OPENSSL_LIBRARIES} +) + +#Includes +SET(INK_INCLUDES +${CMAKE_BINARY_DIR} +${PROJECT_SOURCE_DIR} +${PROJECT_SOURCE_DIR}/src +${GTK2_INCLUDE_DIRS} +${GTKMM_INCLUDE_DIRS} +${SIGC++_INCLUDE_DIRS} +${GSL_INCLUDE_DIRS} +${XML2_INCLUDE_DIRS} +${XSLT_INCLUDE_DIRS} +${IMAGEMAGICK++_INCLUDE_DIRS} +${FREETYPE2_INCLUDE_DIRS} +${GNOMEVFS2_INCLUDE_DIRS} +${BOOST_INCLUDE_DIRS} +${BOEHMGC_INCLUDE_DIRS} +${PNG_INCLUDE_DIRS} +${POPT_INCLUDE_DIRS} +${OPENSSL_INCLUDE_DIRS} +) +#C/C++ Flags +INCLUDE_DIRECTORIES(${INK_INCLUDES}) + +#INCLUDE(ConfigCompileFlags) +INCLUDE(ConfigChecks) diff --git a/CMakeScripts/FindGDKMM.cmake b/CMakeScripts/FindGDKMM.cmake index 37723349c..60c98e096 100644 --- a/CMakeScripts/FindGDKMM.cmake +++ b/CMakeScripts/FindGDKMM.cmake @@ -37,6 +37,7 @@ else (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/include/gdkmm-2.4 /sw/include PATH_SUFFIXES gdkmm-2.4 @@ -50,6 +51,7 @@ else (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/lib/gdkmm-2.4/include /sw/include /usr/lib/gdkmm-2.4/include /usr/lib64/gdkmm-2.4/include diff --git a/CMakeScripts/FindGIOMM.cmake b/CMakeScripts/FindGIOMM.cmake index 4a1bc8133..953f84b68 100644 --- a/CMakeScripts/FindGIOMM.cmake +++ b/CMakeScripts/FindGIOMM.cmake @@ -37,6 +37,7 @@ else (GIOMM_LIBRARIES AND GIOMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/include/giomm-2.4/ /sw/include PATH_SUFFIXES giomm-2.4 diff --git a/CMakeScripts/FindGLIBMM.cmake b/CMakeScripts/FindGLIBMM.cmake index bfbb55917..435faf868 100644 --- a/CMakeScripts/FindGLIBMM.cmake +++ b/CMakeScripts/FindGLIBMM.cmake @@ -37,6 +37,7 @@ else (GLIBMM_LIBRARIES AND GLIBMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/lib/glibmm-2.4/include /sw/include PATH_SUFFIXES glibmm-2.4 @@ -50,6 +51,7 @@ else (GLIBMM_LIBRARIES AND GLIBMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/lib/glibmm-2.4/include /sw/include /usr/lib/glibmm-2.4/include /usr/lib64/glibmm-2.4/include diff --git a/CMakeScripts/FindGTK2.cmake b/CMakeScripts/FindGTK2.cmake index 9c7346e1d..06105bd04 100644 --- a/CMakeScripts/FindGTK2.cmake +++ b/CMakeScripts/FindGTK2.cmake @@ -96,6 +96,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /usr/include/gtk-2.0 /usr/local/include/gtk-2.0 /opt/gnome/include/gtk-2.0 + /opt/local/include/gtk-2.0 $ENV{DEVLIBS_PATH}//include// ) @@ -120,6 +121,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/lib/glib-2.0/include /usr/lib64/glib-2.0/include /usr/lib/glib-2.0/include + /opt/local/lib/glib-2.0/include $ENV{DEVLIBS_PATH}//include// ) #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}") @@ -128,6 +130,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) ${_GLIB2_INCLUDEDIR} /opt/gnome/include/glib-2.0 /usr/include/glib-2.0 + /opt/local/include/glib-2.0 $ENV{DEVLIBS_PATH}//include// ) #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}") @@ -138,6 +141,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /usr/local/include /usr/openwin/share/include /opt/gnome/include + /opt/local/include $ENV{DEVLIBS_PATH}//include// ) @@ -153,6 +157,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) ${_PANGO_INCLUDEDIR} /opt/gnome/include/pango-1.0 /usr/include/pango-1.0 + /opt/local/include/pango-1.0 $ENV{DEVLIBS_PATH}//include// ) @@ -170,6 +175,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/lib64/gtk-2.0/include /usr/lib/gtk-2.0/include /usr/lib64/gtk-2.0/include + /opt/local/lib/gtk-2.0/include $ENV{DEVLIBS_PATH}//include// ) @@ -186,6 +192,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) /opt/gnome/include/cairo /usr/include /usr/include/cairo + /opt/local/include/cairo $ENV{DEVLIBS_PATH}//include// ) #MESSAGE(STATUS "DEBUG: GTK2_CAIRO_INCLUDE_PATH = ${GTK2_CAIRO_INCLUDE_PATH}") @@ -202,6 +209,7 @@ ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) ${_ATK_INCLUDEDIR} /opt/gnome/include/atk-1.0 /usr/include/atk-1.0 + /opt/local/include/atk-1.0 $ENV{DEVLIBS_PATH}//include// ) #MESSAGE(STATUS "DEBUG: GTK2_ATK_INCLUDE_PATH = ${GTK2_ATK_INCLUDE_PATH}") diff --git a/CMakeScripts/FindGtkMM.cmake b/CMakeScripts/FindGtkMM.cmake index 0c4749906..1c9839503 100644 --- a/CMakeScripts/FindGtkMM.cmake +++ b/CMakeScripts/FindGtkMM.cmake @@ -50,6 +50,7 @@ else (GTKMM_LIBRARIES AND GTKMM_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/lib/gtkmm-2.4/include /sw/include /usr/lib/gtkmm-2.4/include /usr/lib64/gtkmm-2.4/include @@ -101,7 +102,7 @@ find_package(CAIROMM REQUIRED) ${ATKMM_LIBRARIES} ${GDKMM_LIBRARIES} ${GIOMM_LIBRARIES} - ${GLIBKMM_LIBRARIES} + ${GLIBMM_LIBRARIES} ${PANGOMM_LIBRARIES} ${CAIROMM_LIBRARIES} ) diff --git a/CMakeScripts/FindSigC++.cmake b/CMakeScripts/FindSigC++.cmake index 62681cf7f..ed0abc545 100644 --- a/CMakeScripts/FindSigC++.cmake +++ b/CMakeScripts/FindSigC++.cmake @@ -51,6 +51,7 @@ else (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS) /usr/include /usr/local/include /opt/local/include + /opt/local/lib/sigc++-2.0/include /sw/include /usr/lib/sigc++-2.0/include /usr/lib64/sigc++-2.0/include diff --git a/src/2geom/CMakeLists.txt b/src/2geom/CMakeLists.txt index 9aea995d2..e75c6174b 100644 --- a/src/2geom/CMakeLists.txt +++ b/src/2geom/CMakeLists.txt @@ -1,30 +1,3 @@ -#generate parser file with ragel -SET(SVG_PARSER_CPP "${CMAKE_CURRENT_SOURCE_DIR}/svg-path-parser.cpp") -SET(SVG_PARSER_TMP "${CMAKE_CURRENT_SOURCE_DIR}/svg-path-parser.tmp") -SET(SVG_PARSER_RL "${CMAKE_CURRENT_SOURCE_DIR}/svg-path-parser.rl") -SET(GENERATE_SVG_PARSER NOT EXISTS "${SVG_PARSER_CPP}") -SET(REGENERATE_SVG_PARSER "${SVG_PARSER_CPP}" IS_NEWER_THAN "${SVG_PARSER_RL}") -IF( EXISTS "/usr/bin/ragel" OR EXISTS "/usr/local/bin/ragel" ) -IF(GENERATE_SVG_PARSER OR REGENERATE_SVG_PARSER) - EXECUTE_PROCESS(COMMAND ragel --version OUTPUT_VARIABLE CMD_OUTPUT ERROR_QUIET) - STRING(REGEX MATCH "version [0-9]+[.]*[0-9]*" RALEG_VERSION ${CMD_OUTPUT}) - STRING(REGEX REPLACE "version ([0-9]+).*" "\\1" RALEG_MAJOR ${RALEG_VERSION}) - STRING(REGEX MATCH "[0-9]+$" RALEG_MINOR ${RALEG_VERSION}) - IF( ${RALEG_MAJOR} LESS 6 AND ${RALEG_MINOR} LESS 18 ) - SET(RLCODEGEN_CMD rlcodegen) - ELSE( ${RALEG_MAJOR} LESS 6 AND ${RALEG_MINOR} LESS 18 ) - SET(RLCODEGEN_CMD rlgen-cd) - ENDIF( ${RALEG_MAJOR} LESS 6 AND ${RALEG_MINOR} LESS 18 ) - ADD_CUSTOM_COMMAND(OUTPUT "${SVG_PARSER_CPP}" - COMMAND ragel -o "${SVG_PARSER_TMP}" "${SVG_PARSER_RL}" - COMMAND ${RLCODEGEN_CMD} -T0 -o "${SVG_PARSER_CPP}" "${SVG_PARSER_TMP}" - DEPENDS "${SVG_PARSER_RL}" - WORKING_DIRECTORY "${CURRENT_SOURCE_DIR}" - COMMENT "Generating svg_path_parser.cpp with ragel" - ) -ENDIF(GENERATE_SVG_PARSER OR REGENERATE_SVG_PARSER) -ENDIF( EXISTS "/usr/bin/ragel" OR EXISTS "/usr/local/bin/ragel" ) - SET(2GEOM_SRC svg-path.h @@ -151,17 +124,3 @@ numeric/matrix.cpp ADD_LIBRARY(2geom ${LIB_TYPE} ${2GEOM_SRC}) #TARGET_LINK_LIBRARIES(2geom blas gsl) TARGET_LINK_LIBRARIES(2geom "${LINK_GSL} ${GTK2_LINK_FLAGS}") -INSTALL(TARGETS 2geom - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) -FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.h") -INSTALL(FILES ${files} DESTINATION include/2geom/2geom) - -#CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/2geom.pc.in -# ${CMAKE_BINARY_DIR}/2geom.pc @ONLY IMMEDIATE ) -#INSTALL(FILES "${CMAKE_BINARY_DIR}/2geom.pc" DESTINATION lib/pkgconfig) -#ADD_SUBDIRECTORY (toys) -#ADD_SUBDIRECTORY (tests) -#ADD_SUBDIRECTORY (py2geom) -- 2.30.2