pimageformats/imageformats/svg/CMakeLists.txt

27 lines
823 B
CMake

set (plugin pimg_svg)
set (PLUGIN_SOURCES
main.cpp
svg_p.h
svg.cpp
# since dtkgui still cannot compile under platforms other than Linux...
dsvgrenderer.h
dsvgrenderer.cpp
)
find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Svg)
find_package(PkgConfig REQUIRED)
pkg_check_modules(rsvg REQUIRED librsvg-2.0 IMPORTED_TARGET)
# {{{ KCM style
set(CMAKE_SHARED_MODULE_PREFIX "")
unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# }}}
add_library(${plugin} MODULE ${PLUGIN_SOURCES})
set_property(TARGET ${plugin} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS "svg.json")
set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/imageformats")
target_link_libraries(${plugin} Qt5::Gui Qt5::Svg PkgConfig::rsvg)