added svg2qvg cmake function
This commit is contained in:
parent
e23230be98
commit
f2ec4f862f
|
@ -5,33 +5,28 @@ list(APPEND TARGET_SOURCES
|
|||
MainWindow.cpp
|
||||
main.cpp)
|
||||
|
||||
set(TARGET_NAME qvgviewer)
|
||||
|
||||
#CONFIG += autoqvg
|
||||
|
||||
option(autoqvg "enable automatic qvg commpilation" OFF)
|
||||
|
||||
if(autoqvg)
|
||||
# CONFIG += qskqvg # TODO why?
|
||||
|
||||
list(APPEND TARGET_RESSOURCES
|
||||
qvgviewer.qrc)
|
||||
|
||||
list(APPEND SVGSOURCES
|
||||
list(APPEND TARGET_SVGS
|
||||
svg/01.01.10.svg
|
||||
svg/01.03.04q.svg
|
||||
svg/01.08.05q.svg
|
||||
svg/01.25.18.svg)
|
||||
else()
|
||||
# When cross compiling we need to have the svg2qvg tool being
|
||||
# compiled for the build environment - not for the one of the target.
|
||||
# So we better have precompiled qvg files in the repository to
|
||||
# make the build process much easier
|
||||
list(APPEND TARGET_RESSOURCES
|
||||
qvgviewer.qrc)
|
||||
endif()
|
||||
|
||||
add_executable(${TARGET_NAME} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESSOURCES})
|
||||
list(APPEND TARGET_QVGS
|
||||
qvg/01.01.10.qvg
|
||||
qvg/01.03.04q.qvg
|
||||
qvg/01.08.05q.qvg
|
||||
qvg/01.25.18.qvg)
|
||||
|
||||
set(TARGET_NAME qvgviewer)
|
||||
|
||||
add_executable(${TARGET_NAME}
|
||||
${TARGET_SOURCES}
|
||||
${TARGET_HEADERS}
|
||||
${TARGET_RESSOURCES}
|
||||
${TARGET_SVGS})
|
||||
|
||||
set_target_properties(${TARGET_NAME}
|
||||
PROPERTIES
|
||||
|
@ -43,3 +38,25 @@ target_link_libraries(${TARGET_NAME}
|
|||
PRIVATE
|
||||
qskinny
|
||||
qsktestsupport)
|
||||
|
||||
option(autoqvg "enable automatic qvg commpilation" OFF)
|
||||
|
||||
if(autoqvg)
|
||||
svg2qvg(${CMAKE_CURRENT_LIST_DIR}/svg/01.01.10.svg
|
||||
${CMAKE_CURRENT_LIST_DIR}/qvg/01.01.10.qvg)
|
||||
svg2qvg(${CMAKE_CURRENT_LIST_DIR}/svg/01.03.04q.svg
|
||||
${CMAKE_CURRENT_LIST_DIR}/qvg/01.03.04q.qvg)
|
||||
svg2qvg(${CMAKE_CURRENT_LIST_DIR}/svg/01.08.05q.svg
|
||||
${CMAKE_CURRENT_LIST_DIR}/qvg/01.08.05q.qvg)
|
||||
svg2qvg(${CMAKE_CURRENT_LIST_DIR}/svg/01.25.18.svg
|
||||
${CMAKE_CURRENT_LIST_DIR}/qvg/01.25.18.qvg)
|
||||
else()
|
||||
# When cross compiling we need to have the svg2qvg tool being
|
||||
# compiled for the build environment - not for the one of the target.
|
||||
# So we better have precompiled qvg files in the repository to
|
||||
# make the build process much easier
|
||||
endif()
|
||||
|
||||
target_sources(${TARGET_NAME} PRIVATE ${TARGET_QVGS})
|
||||
source_group("generated" FILES ${TARGET_QVGS})
|
||||
source_group("svg" FILES ${TARGET_SVGS})
|
|
@ -0,0 +1,13 @@
|
|||
if(TARGET Qt5::Svg)
|
||||
## @param SVG_FILENAME absolute filename to the svg
|
||||
## @param QVG_FILENAME absolute filename to the qvg
|
||||
function(svg2qvg SVG_FILENAME QVG_FILENAME)
|
||||
get_filename_component(SVG_FILENAME ${SVG_FILENAME} ABSOLUTE)
|
||||
add_custom_command(
|
||||
COMMAND svg2qvg ${SVG_FILENAME} ${QVG_FILENAME}
|
||||
OUTPUT ${QVG_FILENAME}
|
||||
DEPENDS ${SVG_FILENAME}
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:Qt5::Svg>
|
||||
COMMENT "Compiling ${SVG_FILENAME} to ${QVG_FILENAME}")
|
||||
endfunction()
|
||||
endif()
|
|
@ -1,4 +1,5 @@
|
|||
include(${CMAKE_SOURCE_DIR}/features/qskconfig.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/scripts/cmake/qskinny-macros.cmake)
|
||||
|
||||
#TODO
|
||||
#QSK_SUBDIRS = common graphic nodes controls layouts dialogs inputpanel
|
||||
|
|
Loading…
Reference in New Issue