diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2015-11-12 22:35:18 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2015-11-12 22:35:18 +0000 |
| commit | ac1a99494b6afaf5673f260f0e75559eff3b5ff5 (patch) | |
| tree | a457d10b494b9b37fd282dcf4425ee4f9c159351 | |
| parent | Enable builds without flood/trace on systems without Potrace (diff) | |
| download | inkscape-ac1a99494b6afaf5673f260f0e75559eff3b5ff5.tar.gz inkscape-ac1a99494b6afaf5673f260f0e75559eff3b5ff5.zip | |
Update cmake Potrace module to match style of others
(bzr r14449.1.5)
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 2 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindPotrace.cmake | 92 |
2 files changed, 60 insertions, 34 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index e0857f265..ea0867535 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -198,7 +198,7 @@ list(APPEND INKSCAPE_LIBS ${POPT_LIBRARIES}) add_definitions(${POPT_DEFINITIONS}) find_package(Potrace REQUIRED) -list(APPEND INKSCAPE_INCS_SYS ${POTRACE_INCLUDE_DIR}) +list(APPEND INKSCAPE_INCS_SYS ${POTRACE_INCLUDE_DIRS}) list(APPEND INKSCAPE_LIBS ${POTRACE_LIBRARIES}) if(WITH_DBUS) diff --git a/CMakeScripts/Modules/FindPotrace.cmake b/CMakeScripts/Modules/FindPotrace.cmake index a542394fe..9ab995278 100644 --- a/CMakeScripts/Modules/FindPotrace.cmake +++ b/CMakeScripts/Modules/FindPotrace.cmake @@ -1,36 +1,62 @@ # POTRACE_FOUND - system has Potrace -# POTRACE_INCLUDE_DIR - the Potrace include directory +# POTRACE_INCLUDE_DIRS - the Potrace include directory # POTRACE_LIBRARIES - The libraries needed to use Potrace -FIND_PATH(POTRACE_INCLUDE_DIR potracelib.h - /usr/include - /usr/local/include -) - -FIND_LIBRARY(POTRACE_LIBRARY NAMES potrace libpotrace - PATHS - /usr/lib - /usr/local/lib -) - -if (POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY) - set(POTRACE_FOUND TRUE) - set(POTRACE_LIBRARIES ${POTRACE_LIBRARY}) -else (POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY) - set(POTRACE_FOUND FALSE) -endif (POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY) - -if (POTRACE_FOUND) - if (NOT Potrace_FIND_QUIETLY) - message(STATUS "Found potrace: ${POTRACE_LIBRARIES}") - endif (NOT Potrace_FIND_QUIETLY) -else (POTRACE_FOUND) - if (NOT Potrace_FIND_QUIETLY) - - message(STATUS "don't find potrace") - - endif (NOT Potrace_FIND_QUIETLY) -endif (POTRACE_FOUND) - -MARK_AS_ADVANCED(POTRACE_INCLUDE_DIR POTRACE_LIBRARIES POTRACE_LIBRARY) - +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) |
