2022-05-05 16:13:02 -04:00
|
|
|
#############################################################################
|
|
|
|
# Name: build/cmake/lib/nanosvg.cmake
|
|
|
|
# Purpose: Use external or internal nanosvg lib
|
|
|
|
# Author: Tamas Meszaros, Maarten Bent
|
|
|
|
# Created: 2022-05-05
|
|
|
|
# Copyright: (c) 2022 wxWidgets development team
|
|
|
|
# Licence: wxWindows licence
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
if(wxUSE_NANOSVG STREQUAL "builtin")
|
|
|
|
set(wxUSE_NANOSVG_EXTERNAL 0 PARENT_SCOPE)
|
|
|
|
elseif(wxUSE_NANOSVG)
|
|
|
|
set(wxUSE_NANOSVG_EXTERNAL 1 PARENT_SCOPE)
|
|
|
|
|
2022-05-05 18:17:44 -04:00
|
|
|
set(NANOSVG_LIBRARIES )
|
|
|
|
set(NANOSVG_INCLUDE_DIRS )
|
|
|
|
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL TRUE)
|
|
|
|
|
2022-05-05 16:13:02 -04:00
|
|
|
find_package(NanoSVG REQUIRED)
|
|
|
|
|
2022-05-05 18:17:44 -04:00
|
|
|
foreach(TARGETNAME NanoSVG::nanosvg NanoSVG::nanosvgrast unofficial::nanosvg)
|
|
|
|
if(NOT TARGET ${TARGETNAME})
|
|
|
|
continue()
|
|
|
|
endif()
|
2022-05-05 18:17:05 -04:00
|
|
|
|
2022-05-05 18:17:44 -04:00
|
|
|
list(APPEND NANOSVG_LIBRARIES ${TARGETNAME})
|
|
|
|
get_target_property(svg_incl_dir ${TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
if(svg_incl_dir)
|
|
|
|
list(APPEND NANOSVG_INCLUDE_DIRS ${svg_incl_dir})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
get_target_property(svg_lib_d ${TARGETNAME} IMPORTED_LOCATION_DEBUG)
|
|
|
|
get_target_property(svg_lib_r ${TARGETNAME} IMPORTED_LOCATION_RELEASE)
|
|
|
|
get_target_property(svg_lib ${TARGETNAME} IMPORTED_LOCATION)
|
|
|
|
if(svg_lib_d OR svg_lib_r OR svg_lib)
|
|
|
|
set(wxUSE_NANOSVG_EXTERNAL_ENABLE_IMPL FALSE)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2022-05-05 16:13:02 -04:00
|
|
|
endif()
|