diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2015-12-07 10:00:35 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2015-12-07 10:00:35 +0000 |
| commit | 457c41675d69c7463c3590ad9b8e43bcae20e611 (patch) | |
| tree | 43d1f8d4e350a3070944bbd7bb4ad265c1b6ed02 /CMakeScripts | |
| parent | merge from trunk (r14473) (diff) | |
| parent | Remove leftover assert. (diff) | |
| download | inkscape-457c41675d69c7463c3590ad9b8e43bcae20e611.tar.gz inkscape-457c41675d69c7463c3590ad9b8e43bcae20e611.zip | |
merge from trunk (r14506)
(bzr r14425.1.4)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 11 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindPotrace.cmake | 62 |
2 files changed, 73 insertions, 0 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 63e4315b8..f4992de5d 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -197,6 +197,17 @@ list(APPEND INKSCAPE_INCS_SYS ${POPT_INCLUDE_DIR}) list(APPEND INKSCAPE_LIBS ${POPT_LIBRARIES}) add_definitions(${POPT_DEFINITIONS}) +find_package(Potrace) +if(POTRACE_FOUND) + list(APPEND INKSCAPE_INCS_SYS ${POTRACE_INCLUDE_DIRS}) + list(APPEND INKSCAPE_LIBS ${POTRACE_LIBRARIES}) + set(HAVE_POTRACE ON) + add_definitions(-DHAVE_POTRACE) +else(POTRACE_FOUND) + set(HAVE_POTRACE OFF) + message(STATUS "Could not locate the Potrace library headers: the Trace Bitmap and Paintbucket tools will be disabled") +endif() + if(WITH_DBUS) find_package(DBus REQUIRED) if(DBUS_FOUND) diff --git a/CMakeScripts/Modules/FindPotrace.cmake b/CMakeScripts/Modules/FindPotrace.cmake new file mode 100644 index 000000000..9ab995278 --- /dev/null +++ b/CMakeScripts/Modules/FindPotrace.cmake @@ -0,0 +1,62 @@ +# POTRACE_FOUND - system has Potrace +# POTRACE_INCLUDE_DIRS - the Potrace include directory +# POTRACE_LIBRARIES - The libraries needed to use Potrace + +IF (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) + # in cache already + SET(POTRACE_FOUND TRUE) +ELSE (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) + FIND_PATH (POTRACE_INCLUDE_DIR + NAMES + potracelib.h + PATHS + /usr/include + /usr/local/include + $ENV{DEVLIBS_PATH}/include + PATH_SUFFIXES + potrace + ) + + FIND_LIBRARY (POTRACE_LIBRARY + NAMES + potrace + libpotrace + PATHS + /usr/lib + /usr/local/lib + $ENV{DEVLIBS_PATH}/lib + ) + + if (POTRACE_LIBRARY) + set (POTRACE_FOUND TRUE) + endif (POTRACE_LIBRARY) + + set (POTRACE_INCLUDE_DIRS + ${POTRACE_INCLUDE_DIR} + ) + + if (POTRACE_FOUND) + set(POTRACE_LIBRARIES + ${POTRACE_LIBRARIES} + ${POTRACE_LIBRARY} + ) + endif (POTRACE_FOUND) + + if (POTRACE_INCLUDE_DIRS AND POTRACE_LIBRARIES) + set(POTRACE_FOUND TRUE) + endif (POTRACE_INCLUDE_DIRS AND POTRACE_LIBRARIES) + + if (POTRACE_FOUND) + if (NOT Potrace_FIND_QUIETLY) + message(STATUS "Found Potrace: ${POTRACE_LIBRARIES}") + endif (NOT Potrace_FIND_QUIETLY) + else (POTRACE_FOUND) + if (Potrace_FIND_REQUIRED) + message(FATAL_ERROR "Could not find potrace") + endif (Potrace_FIND_REQUIRED) + endif (POTRACE_FOUND) + + # show the POTRACE_INCLUDE_DIRS and POTRACE_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(POTRACE_INCLUDE_DIRS POTRACE_LIBRARIES) + +endif (POTRACE_LIBRARIES AND POTRACE_INCLUDE_DIRS) |
