Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for SVG symbology in cmake build (#4634)
note that svg-cairo does not properly link against current versions of cairo as it uses an obsolete API. Support for SVG symbols is disabled by default because of this
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# - Find LibSVG and LibSVG-Cairo | ||
# | ||
# Following variables are provided: | ||
# SVG_FOUND | ||
# True if libsvg has been found | ||
# SVG_INCLUDE_DIR | ||
# The include directories of libsvg | ||
# SVG_LIBRARY | ||
# libsvg library list | ||
# Following variables are provided: | ||
# SVGCAIRO_FOUND | ||
# True if libsvg-cairo has been found | ||
# SVGCAIRO_INCLUDE_DIR | ||
# The include directories of libsvg-cairo | ||
# SVGCAIRO_LIBRARY | ||
# libsvg-cairo library list | ||
|
||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(PC_SVG QUIET libsvg>=0.1.4) | ||
pkg_check_modules(PC_SVGCAIRO QUIET libsvg-cairo>=0.1.6) | ||
|
||
find_path(SVG_INCLUDE_DIR | ||
NAMES svg.h | ||
HINTS ${PC_SVG_INCLUDE_DIR} ${PC_SVG_INCLUDE_DIRS} | ||
) | ||
|
||
find_library(SVG_LIBRARY | ||
NAME svg | ||
HINTS ${PC_SVG_LIBDIR} ${PC_SVG_LIBRARY_DIRS} | ||
) | ||
|
||
find_path(SVGCAIRO_INCLUDE_DIR | ||
NAMES svg-cairo.h | ||
HINTS ${PC_SVGCAIRO_INCLUDE_DIR} ${PC_SVGCAIRO_INCLUDE_DIRS} | ||
) | ||
|
||
find_library(SVGCAIRO_LIBRARY | ||
NAME svg-cairo | ||
HINTS ${PC_SVGCAIRO_LIBDIR} ${PC_SVGCAIRO_LIBRARY_DIRS} | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
set(SVG_INCLUDE_DIRS ${SVG_INCLUDE_DIR}) | ||
set(SVG_LIBRARIES ${SVG_LIBRARY}) | ||
find_package_handle_standard_args(SVG DEFAULT_MSG SVG_LIBRARY SVG_INCLUDE_DIR) | ||
mark_as_advanced(SVG_LIBRARY SVG_INCLUDE_DIR) | ||
set(SVGCAIRO_INCLUDE_DIRS ${SVGCAIRO_INCLUDE_DIR}) | ||
set(SVGCAIRO_LIBRARIES ${SVGCAIRO_LIBRARY}) | ||
find_package_handle_standard_args(SVGCAIRO DEFAULT_MSG SVGCAIRO_LIBRARY SVGCAIRO_INCLUDE_DIR) | ||
mark_as_advanced(SVGCAIRO_LIBRARY SVGCAIRO_INCLUDE_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters