summaryrefslogtreecommitdiffstats
path: root/CMakeScripts
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-07-01 02:03:38 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-07-01 02:03:38 +0000
commit0d5bb885dee83f041830dc950d3be6f21a37f08b (patch)
tree88a0ae7a15ed496ddad1f83f43547783b88843ac /CMakeScripts
parentBug fixes (diff)
parentAdd Mac CI build config (diff)
downloadinkscape-0d5bb885dee83f041830dc950d3be6f21a37f08b.tar.gz
inkscape-0d5bb885dee83f041830dc950d3be6f21a37f08b.zip
update to trunk
Diffstat (limited to 'CMakeScripts')
-rw-r--r--CMakeScripts/DefineDependsandFlags.cmake43
-rw-r--r--CMakeScripts/Modules/FindJeMalloc.cmake70
-rw-r--r--CMakeScripts/inkscape-version.cmake20
3 files changed, 126 insertions, 7 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
index 52410fb2b..0a8782f27 100644
--- a/CMakeScripts/DefineDependsandFlags.cmake
+++ b/CMakeScripts/DefineDependsandFlags.cmake
@@ -67,6 +67,11 @@ if(WITH_GNOME_VFS)
endif()
endif()
+find_package(JeMalloc)
+if (JEMALLOC_FOUND)
+ list(APPEND INKSCAPE_LIBS ${JEMALLOC_LIBRARIES})
+endif()
+
if(ENABLE_LCMS)
unset(HAVE_LIBLCMS1)
unset(HAVE_LIBLCMS2)
@@ -258,6 +263,42 @@ set(TRY_GTKSPELL ON)
set (WITH_GTKMM_3_10 ON)
endif()
+ # Check whether we can use new features in Gtkmm 3.12
+ # TODO: Drop this test and bump the version number in the GTK test above
+ # as soon as all supported distributions provide Gtkmm >= 3.12
+ pkg_check_modules(GTKMM_3_12
+ gtkmm-3.0>=3.12,
+ )
+
+ if("${GTKMM_3_12_FOUND}")
+ message("Using Gtkmm 3.12 build")
+ set (WITH_GTKMM_3_12 ON)
+ endif()
+
+ # Check whether we can use new features in Gtkmm 3.16
+ # TODO: Drop this test and bump the version number in the GTK test above
+ # as soon as all supported distributions provide Gtkmm >= 3.16
+ pkg_check_modules(GTKMM_3_16
+ gtkmm-3.0>=3.16,
+ )
+
+ if("${GTKMM_3_16_FOUND}")
+ message("Using Gtkmm 3.16 build")
+ set (WITH_GTKMM_3_16 ON)
+ endif()
+
+ # Check whether we can use new features in Gtkmm 3.22
+ # TODO: Drop this test and bump the version number in the GTK test above
+ # as soon as all supported distributions provide Gtkmm >= 3.22
+ pkg_check_modules(GTKMM_3_22
+ gtkmm-3.0>=3.22,
+ )
+
+ if("${GTKMM_3_22_FOUND}")
+ message("Using Gtkmm 3.22 build")
+ set (WITH_GTKMM_3_22 ON)
+ endif()
+
pkg_check_modules(GDL_3_6 gdl-3.0>=3.6)
if("${GDL_3_6_FOUND}")
@@ -337,7 +378,7 @@ list(APPEND INKSCAPE_INCS_SYS ${ZLIB_INCLUDE_DIRS})
list(APPEND INKSCAPE_LIBS ${ZLIB_LIBRARIES})
if(WITH_IMAGE_MAGICK)
- pkg_check_modules(ImageMagick ImageMagick MagickCore Magick++ )
+ pkg_check_modules(ImageMagick ImageMagick++ )
if(ImageMagick_FOUND)
list(APPEND INKSCAPE_LIBS ${ImageMagick_LDFLAGS})
diff --git a/CMakeScripts/Modules/FindJeMalloc.cmake b/CMakeScripts/Modules/FindJeMalloc.cmake
new file mode 100644
index 000000000..5c7aa2cf1
--- /dev/null
+++ b/CMakeScripts/Modules/FindJeMalloc.cmake
@@ -0,0 +1,70 @@
+# - Find JeMalloc library
+# Find the native JeMalloc includes and library
+# This module defines
+# JEMALLOC_INCLUDE_DIRS, where to find jemalloc.h, Set when
+# JEMALLOC_INCLUDE_DIR is found.
+# JEMALLOC_LIBRARIES, libraries to link against to use JeMalloc.
+# JEMALLOC_ROOT_DIR, The base directory to search for JeMalloc.
+# This can also be an environment variable.
+# JEMALLOC_FOUND, If false, do not try to use JeMalloc.
+#
+# also defined, but not for general use are
+# JEMALLOC_LIBRARY, where to find the JeMalloc library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If JEMALLOC_ROOT_DIR was defined in the environment, use it.
+IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "")
+ SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR})
+ENDIF()
+
+SET(_jemalloc_SEARCH_DIRS
+ ${JEMALLOC_ROOT_DIR}
+ /usr/local
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+)
+
+FIND_PATH(JEMALLOC_INCLUDE_DIR
+ NAMES
+ jemalloc.h
+ HINTS
+ ${_jemalloc_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/jemalloc
+)
+
+FIND_LIBRARY(JEMALLOC_LIBRARY
+ NAMES
+ jemalloc
+ HINTS
+ ${_jemalloc_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib
+ )
+
+# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
+ JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
+
+IF(JEMALLOC_FOUND)
+ SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
+ SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
+ENDIF(JEMALLOC_FOUND)
+
+MARK_AS_ADVANCED(
+ JEMALLOC_INCLUDE_DIR
+ JEMALLOC_LIBRARY
+)
diff --git a/CMakeScripts/inkscape-version.cmake b/CMakeScripts/inkscape-version.cmake
index 2e23925c4..12b8a26d8 100644
--- a/CMakeScripts/inkscape-version.cmake
+++ b/CMakeScripts/inkscape-version.cmake
@@ -11,14 +11,22 @@
set(INKSCAPE_REVISION "unknown")
set(INKSCAPE_CUSTOM "custom")
-if(EXISTS ${INKSCAPE_SOURCE_DIR}/.bzr/)
- execute_process(COMMAND
- bzr revno --tree ${INKSCAPE_SOURCE_DIR}
- OUTPUT_VARIABLE INKSCAPE_REVISION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(EXISTS ${INKSCAPE_SOURCE_DIR}/.git/)
+
+ execute_process(COMMAND git describe
+ COMMAND tr "\n" " "
+ WORKING_DIRECTORY ${INKSCAPE_SOURCE_DIR}
+ OUTPUT_VARIABLE INKSCAPE_REV1)
+ execute_process(COMMAND git show --format=format:%ad --date=short
+ COMMAND head -n 1
+ COMMAND tr "\n" " "
+ WORKING_DIRECTORY ${INKSCAPE_SOURCE_DIR}
+ OUTPUT_VARIABLE INKSCAPE_REV2
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(INKSCAPE_REVISION ${INKSCAPE_REV1} ${INKSCAPE_REV2})
execute_process(COMMAND
- bzr status -S -V ${INKSCAPE_SOURCE_DIR}/src
+ git status -s ${INKSCAPE_SOURCE_DIR}/src
OUTPUT_VARIABLE INKSCAPE_SOURCE_MODIFIED
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT INKSCAPE_SOURCE_MODIFIED STREQUAL "")