Browse Source

Gmt module: Search and use libgs.

ObjPtr
Michael Uleysky 9 years ago
parent
commit
09b2684d4b
  1. 19
      modules/gmt/ModuleSetup.cmake

19
modules/gmt/ModuleSetup.cmake

@ -4,6 +4,21 @@ set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES modgmt_filter_headfo
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
find_package(GMT REQUIRED) find_package(GMT REQUIRED)
# Search ghostscript
if(NOT GHOSTSCRIPT_ROOT_DIR)
set(GHOSTSCRIPT_ROOT_DIR ${CMAKE_INSTALL_PREFIX} CACHE PATH "Ghostscript root path")
endif()
mark_as_advanced(CLEAR GHOSTSCRIPT_ROOT_DIR)
find_path(GHOSTSCRIPT_INCLUDES NAMES ghostscript/gdevdsp.h ghostscript/iapi.h HINTS ${GHOSTSCRIPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX})
find_library(GHOSTSCRIPT_LIBRARY gs HINTS ${GHOSTSCRIPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX})
if(NOT GHOSTSCRIPT_INCLUDES)
message(FATAL_ERROR "Ghostscript includes not found!")
endif()
if(NOT GHOSTSCRIPT_LIBRARY)
message(FATAL_ERROR "Ghostscript library not found!")
endif()
set(MODULE_ADDITIONAL_SOURCES ${FLEX_GMT_hfScanner_OUTPUTS}) set(MODULE_ADDITIONAL_SOURCES ${FLEX_GMT_hfScanner_OUTPUTS})
set(MODULE_ADDITIONAL_INCLUDES ${GMT_INCLUDE_DIR}) set(MODULE_ADDITIONAL_INCLUDES ${GMT_INCLUDE_DIR} ${GHOSTSCRIPT_INCLUDES})
set(MODULE_ADDITIONAL_LIBRARIES ${GMT_LIBRARIES}) set(MODULE_ADDITIONAL_LIBRARIES ${GMT_LIBRARIES} ${GHOSTSCRIPT_LIBRARY})

Loading…
Cancel
Save