summaryrefslogtreecommitdiffstats
path: root/CMakeScripts/Modules/FindPotrace.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:50:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:50:49 +0000
commitc853ffb5b2f75f5a889ed2e3ef89b818a736e87a (patch)
tree7d13a0883bb7936b84d6ecdd7bc332b41ed04bee /CMakeScripts/Modules/FindPotrace.cmake
parentInitial commit. (diff)
downloadinkscape-8a99dde12f4056f9f3e8c91d10a929dbb60d0ab9.tar.xz
inkscape-8a99dde12f4056f9f3e8c91d10a929dbb60d0ab9.zip
Adding upstream version 1.3+ds.upstream/1.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'CMakeScripts/Modules/FindPotrace.cmake')
-rw-r--r--CMakeScripts/Modules/FindPotrace.cmake62
1 files changed, 62 insertions, 0 deletions
diff --git a/CMakeScripts/Modules/FindPotrace.cmake b/CMakeScripts/Modules/FindPotrace.cmake
new file mode 100644
index 0000000..9ab9952
--- /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)