-find_path(PANGOCAIRO_INCLUDE_DIR pango/pangocairo.h PATH_SUFFIXES pango-1.0)
-find_path(GLIB_INCLUDE_DIR glib.h PATH_SUFFIXES glib-2.0)
-find_path(GLIBCONFIG_INCLUDE_DIR glibconfig.h PATH_SUFFIXES glib-2.0/include)
+include(FindPackageHandleStandardArgs)
-find_library(GLIB_LIBRARY NAMES glib-2.0)
-find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
-find_library(PANGO_LIBRARY NAMES pango-1.0)
-find_library(PANGOCAIRO_LIBRARY NAMES pangocairo-1.0)
+if (WIN32)
+ find_path(PangoCairo_INCLUDE_DIR pango/pangocairo.h PATH_SUFFIXES pango-1.0)
+ find_path(GLIB_INCLUDE_DIR glib.h PATH_SUFFIXES glib-2.0)
+ find_path(GLIBCONFIG_INCLUDE_DIR glibconfig.h PATH_SUFFIXES glib-2.0/include)
-find_file(GLIB_RUNTIME_LIBRARY NAMES glib-2.dll)
-find_file(GOBJECT_RUNTIME_LIBRARY NAMES gobject-2.dll)
-find_file(HARFBUZZ_RUNTIME_LIBRARY NAMES libharfbuzz-0.dll)
-find_file(PANGO_RUNTIME_LIBRARY NAMES pango-1.dll)
-find_file(PANGOCAIRO_RUNTIME_LIBRARY NAMES pangocairo-1.dll)
-find_file(PANGOFT_RUNTIME_LIBRARY NAMES pangoft2-1.dll)
-find_file(PANGOWIN_RUNTIME_LIBRARY NAMES pangowin32-1.dll)
+ find_library(GLIB_LIBRARY NAMES glib-2.0)
+ find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
+ find_library(PANGO_LIBRARY NAMES pango-1.0)
+ find_library(PangoCairo_LIBRARY NAMES pangocairo-1.0)
-include(FindPackageHandleStandardArgs)
-if (WIN32)
- find_package_handle_standard_args(PANGOCAIRO DEFAULT_MSG
+ find_file(GLIB_RUNTIME_LIBRARY NAMES glib-2.dll)
+ find_file(GOBJECT_RUNTIME_LIBRARY NAMES gobject-2.dll)
+ find_file(HARFBUZZ_RUNTIME_LIBRARY NAMES libharfbuzz-0.dll)
+ find_file(PANGO_RUNTIME_LIBRARY NAMES pango-1.dll)
+ find_file(PangoCairo_RUNTIME_LIBRARY NAMES pangocairo-1.dll)
+ find_file(PANGOFT_RUNTIME_LIBRARY NAMES pangoft2-1.dll)
+ find_file(PANGOWIN_RUNTIME_LIBRARY NAMES pangowin32-1.dll)
+
+ find_package_handle_standard_args(PangoCairo DEFAULT_MSG
GLIB_INCLUDE_DIR
GLIBCONFIG_INCLUDE_DIR
- PANGOCAIRO_INCLUDE_DIR
+ PangoCairo_INCLUDE_DIR
GLIB_LIBRARY
GOBJECT_LIBRARY
PANGO_LIBRARY
- PANGOCAIRO_LIBRARY
+ PangoCairo_LIBRARY
GLIB_RUNTIME_LIBRARY
GOBJECT_RUNTIME_LIBRARY
HARFBUZZ_RUNTIME_LIBRARY
PANGO_RUNTIME_LIBRARY
- PANGOCAIRO_RUNTIME_LIBRARY
+ PangoCairo_RUNTIME_LIBRARY
PANGOFT_RUNTIME_LIBRARY
PANGOWIN_RUNTIME_LIBRARY
)
-else()
- find_package_handle_standard_args(PANGOCAIRO DEFAULT_MSG
- GLIB_INCLUDE_DIR
- GLIBCONFIG_INCLUDE_DIR
- PANGOCAIRO_INCLUDE_DIR
- GLIB_LIBRARY
- GOBJECT_LIBRARY
- PANGO_LIBRARY
- PANGOCAIRO_LIBRARY
+ set(PangoCairo_INCLUDE_DIRS
+ ${GLIB_INCLUDE_DIR}
+ ${GLIBCONFIG_INCLUDE_DIR}
+ ${PangoCairo_INCLUDE_DIR}
)
-endif()
-
-mark_as_advanced(
- GLIB_INCLUDE_DIR
- GLIBCONFIG_INCLUDE_DIR
- PANGOCAIRO_INCLUDE_DIR
- GLIB_LIBRARY
- GOBJECT_LIBRARY
- PANGO_LIBRARY
- PANGOCAIRO_LIBRARY
-
- GLIB_RUNTIME_LIBRARY
- GOBJECT_RUNTIME_LIBRARY
- HARFBUZZ_RUNTIME_LIBRARY
- PANGO_RUNTIME_LIBRARY
- PANGOCAIRO_RUNTIME_LIBRARY
- PANGOFT_RUNTIME_LIBRARY
- PANGOWIN_RUNTIME_LIBRARY
-)
+ set(PangoCairo_LIBRARIES
+ glib-2.0
+ gobject-2.0
+ pango-1.0
+ pangocairo-1.0
+ )
-set(PANGOCAIRO_INCLUDE_DIRS
- ${GLIB_INCLUDE_DIR}
- ${GLIBCONFIG_INCLUDE_DIR}
- ${PANGOCAIRO_INCLUDE_DIR}
-)
+ set(PangoCairo_LINK_LIBRARIES
+ ${GLIB_LIBRARY}
+ ${GOBJECT_LIBRARY}
+ ${PANGO_LIBRARY}
+ ${PangoCairo_LIBRARY}
+ )
-set(PANGOCAIRO_LIBRARIES
- ${GLIB_LIBRARY}
- ${GOBJECT_LIBRARY}
- ${PANGO_LIBRARY}
- ${PANGOCAIRO_LIBRARY}
-)
+ set(PangoCairo_RUNTIME_LIBRARIES
+ ${GLIB_RUNTIME_LIBRARY}
+ ${GOBJECT_RUNTIME_LIBRARY}
+ ${HARFBUZZ_RUNTIME_LIBRARY}
+ ${PANGO_RUNTIME_LIBRARY}
+ ${PangoCairo_RUNTIME_LIBRARY}
+ ${PANGOFT_RUNTIME_LIBRARY}
+ ${PANGOWIN_RUNTIME_LIBRARY}
+ )
+else()
+ find_package(PkgConfig)
+ pkg_check_modules(PangoCairo pangocairo)
-set(PANGOCAIRO_RUNTIME_LIBRARIES
- ${GLIB_RUNTIME_LIBRARY}
- ${GOBJECT_RUNTIME_LIBRARY}
- ${HARFBUZZ_RUNTIME_LIBRARY}
- ${PANGO_RUNTIME_LIBRARY}
- ${PANGOCAIRO_RUNTIME_LIBRARY}
- ${PANGOFT_RUNTIME_LIBRARY}
- ${PANGOWIN_RUNTIME_LIBRARY}
-)
+ find_package_handle_standard_args(PangoCairo DEFAULT_MSG
+ PangoCairo_INCLUDE_DIRS
+ PangoCairo_LIBRARIES
+ PangoCairo_LINK_LIBRARIES
+ )
+endif()
-if(CAIRO_FOUND AND PANGOCAIRO_FOUND)
+if(CAIRO_FOUND AND PangoCairo_FOUND)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${GRAPHVIZ_LIB_DIR}/gvc
${GRAPHVIZ_LIB_DIR}/pathplan
${CAIRO_INCLUDE_DIRS}/cairo
- ${PANGOCAIRO_INCLUDE_DIRS}
+ ${PangoCairo_INCLUDE_DIRS}
)
add_library(gvplugin_pango SHARED
target_link_libraries(gvplugin_pango
gvc
${CAIRO_LIBRARIES}
- ${PANGOCAIRO_LIBRARIES}
+ ${PangoCairo_LINK_LIBRARIES}
)
# Installation location of library files
install(
FILES
${CAIRO_RUNTIME_LIBRARIES}
- ${PANGOCAIRO_RUNTIME_LIBRARIES}
+ ${PangoCairo_RUNTIME_LIBRARIES}
DESTINATION ${BINARY_INSTALL_DIR}
)
endif()
SOVERSION ${GRAPHVIZ_PLUGIN_VERSION}
)
-endif(CAIRO_FOUND AND PANGOCAIRO_FOUND)
+endif()