sources as cmake function parameters

This commit is contained in:
Uwe Rathmann 2023-04-01 17:34:43 +02:00
parent 02d1428280
commit bf496f8d06
34 changed files with 448 additions and 483 deletions

View File

@ -1,3 +1,8 @@
############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
if(TARGET ${Qt}::Svg) if(TARGET ${Qt}::Svg)
## @param SVG_FILENAME absolute filename to the svg ## @param SVG_FILENAME absolute filename to the svg
## @param QVG_FILENAME absolute filename to the qvg ## @param QVG_FILENAME absolute filename to the qvg
@ -13,7 +18,7 @@ if(TARGET ${Qt}::Svg)
endfunction() endfunction()
endif() endif()
function(qsk_add_executable) function(qsk_add_executable target)
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_executable(${ARGV}) qt6_add_executable(${ARGV})
@ -21,9 +26,12 @@ function(qsk_add_executable)
add_executable(${ARGV}) add_executable(${ARGV})
endif() endif()
set_target_properties(${target} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" )
endfunction() endfunction()
function(qsk_add_library) function(qsk_add_library target)
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_library(${ARGV}) qt6_add_library(${ARGV})
@ -31,12 +39,14 @@ function(qsk_add_library)
add_library(${ARGV}) add_library(${ARGV})
endif() endif()
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${target} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
endfunction() endfunction()
function(qsk_add_plugin PLUGIN_NAME TYPE CLASS_NAME) function(qsk_add_plugin target TYPE CLASS_NAME)
cmake_parse_arguments(PARSE_ARGV 3 arg "MANUAL_FINALIZATION" "" "")
# qt6_add_plugin calls add_library as MODULE - even when SHARED # qt6_add_plugin calls add_library as MODULE - even when SHARED
# is requested. In general this ould be the correct type for plugins - # is requested. In general this ould be the correct type for plugins -
@ -46,58 +56,57 @@ function(qsk_add_plugin PLUGIN_NAME TYPE CLASS_NAME)
# the skins into a regular lib and the plugins would contain # the skins into a regular lib and the plugins would contain
# the factories only. TODO ... # the factories only. TODO ...
# So for the moment better don't do: # So for the moment better don't do:
# qt6_add_plugin(${PLUGIN_NAME} SHARED ${CLASS_NAME} ) # qt6_add_plugin(${target} SHARED ${CLASS_NAME} )
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_library(${PLUGIN_NAME} SHARED ) qt6_add_library(${target} SHARED )
else() else()
add_library(${PLUGIN_NAME} SHARED ) add_library(${target} SHARED )
endif() endif()
set_target_properties(${PLUGIN_NAME} PROPERTIES set_target_properties(${target} PROPERTIES
QT_PLUGIN_CLASS_NAME ${CLASS_NAME} ) QT_PLUGIN_CLASS_NAME ${CLASS_NAME} )
target_compile_definitions(${PLUGIN_NAME} PRIVATE QT_PLUGIN ) target_compile_definitions(${target} PRIVATE QT_PLUGIN )
target_sources( ${PLUGIN_NAME} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ) target_sources( ${target} PRIVATE ${arg_UNPARSED_ARGUMENTS} )
target_link_libraries(${PLUGIN_NAME} PRIVATE qskinny) target_link_libraries(${target} PRIVATE qskinny)
set_target_properties(${PLUGIN_NAME} PROPERTIES FOLDER ${TYPE}) set_target_properties(${target} PROPERTIES FOLDER ${TYPE})
# the plugin has to go to .../plugins/${TYPE}/ # the plugin has to go to .../plugins/${TYPE}/
# otherwise it won't be found at runtime ... # otherwise it won't be found at runtime ...
set_target_properties( ${PLUGIN_NAME} PROPERTIES set_target_properties( ${target} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/${TYPE}") LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/${TYPE}")
endfunction() endfunction()
function(qsk_add_example EXAMPLE_NAME) function(qsk_add_example target)
set(TARGET_NAME ${EXAMPLE_NAME}) cmake_parse_arguments(PARSE_ARGV 1 arg "MANUAL_FINALIZATION" "" "")
qsk_add_executable(${TARGET_NAME} WIN32 MACOSX_BUNDLE qsk_add_executable(${target} WIN32 MACOSX_BUNDLE ${arg_UNPARSED_ARGUMENTS} )
${SOURCES} ${HEADERS} ${RESOURCES})
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER examples) set_target_properties(${target} PROPERTIES FOLDER examples)
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${target} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../bin ) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../bin )
target_link_libraries(${TARGET_NAME} PRIVATE qskinny ) target_link_libraries(${target} PRIVATE qskinny )
# not all examples need this one. TODO ... # not all examples need this one. TODO ...
target_link_libraries(${TARGET_NAME} PRIVATE qsktestsupport) target_link_libraries(${target} PRIVATE qsktestsupport)
if( BUILD_QML_EXPORT ) if( BUILD_QML_EXPORT )
# Only needed, when having QML files. Autodetections is possible # Only needed, when having QML files. Autodetections is possible
# by looking into all '*.qrc' files ( rcc --list *.qrc ) for *.qml # by looking into all '*.qrc' files ( rcc --list *.qrc ) for *.qml
# entries TODO ... # entries TODO ...
target_link_libraries(${TARGET_NAME} PRIVATE qskqmlexport) target_link_libraries(${target} PRIVATE qskqmlexport)
endif() endif()
# for examples with subdirectories # for examples with subdirectories
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
endfunction() endfunction()

View File

@ -1,4 +1,6 @@
list(APPEND HEADERS Box.h) ############################################################################
list(APPEND SOURCES Box.cpp main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(boxes) qsk_add_example(boxes Box.h Box.cpp main.cpp)

View File

@ -1,4 +1,9 @@
list(APPEND RESOURCES buttons.qrc) ############################################################################
list(APPEND SOURCES main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(buttons) set(SOURCES main.cpp)
qt_add_resources(SOURCES buttons.qrc)
qsk_add_example(buttons ${SOURCES})

View File

@ -1,3 +1,6 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(desktop) qsk_add_example(desktop main.cpp)

View File

@ -1,6 +1,10 @@
list(APPEND RESOURCES frames.qrc) ############################################################################
list(APPEND HEADERS Frame.h) # QSkinny - Copyright (C) 2016 Uwe Rathmann
list(APPEND SOURCES Frame.cpp main.cpp) # This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(frames) set(SOURCES Frame.h Frame.cpp main.cpp)
qt_add_resources(SOURCES frames.qrc)
qsk_add_example(frames ${SOURCES})

View File

@ -1,22 +1,19 @@
list(APPEND RESOURCES icons.qrc ) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND HEADERS set(SOURCES
label/LabelPage.h label/LabelPage.h label/LabelPage.cpp
inputs/InputPage.h inputs/InputPage.h inputs/InputPage.cpp
progressbar/ProgressBarPage.h progressbar/ProgressBarPage.h progressbar/ProgressBarPage.cpp
button/ButtonPage.h button/ButtonPage.h button/ButtonPage.cpp
selector/SelectorPage.h selector/SelectorPage.h selector/SelectorPage.cpp
dialog/DialogPage.h dialog/DialogPage.h dialog/DialogPage.cpp
Page.h) Page.h Page.cpp
main.cpp
)
qt_add_resources(SOURCES icons.qrc)
list(APPEND SOURCES qsk_add_example(gallery ${SOURCES})
label/LabelPage.cpp
inputs/InputPage.cpp
progressbar/ProgressBarPage.cpp
button/ButtonPage.cpp
selector/SelectorPage.cpp
dialog/DialogPage.cpp
Page.cpp
main.cpp)
qsk_add_example(gallery)

View File

@ -1,4 +1,9 @@
list(APPEND RESOURCES glabels.qrc) ############################################################################
list(APPEND SOURCES main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(glabels) set(SOURCES main.cpp)
qt_add_resources(SOURCES glabels.qrc)
qsk_add_example(glabels ${SOURCES})

View File

@ -1,78 +1,44 @@
list(APPEND RESOURCES images.qrc fonts.qrc) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND SOURCES set(SOURCES
Box.cpp Box.h Box.cpp
BoxWithButtons.cpp BoxWithButtons.h BoxWithButtons.cpp
CircularProgressBar.cpp CircularProgressBar.h CircularProgressBar.cpp
CircularProgressBarSkinlet.cpp CircularProgressBarSkinlet.h CircularProgressBarSkinlet.cpp
DashboardPage.cpp Diagram.h Diagram.cpp
DevicesPage.cpp DiagramSkinlet.h DiagramSkinlet.cpp
Diagram.cpp EnergyMeter.h EnergyMeter.cpp
DiagramSkinlet.cpp GraphicProvider.h GraphicProvider.cpp
EnergyMeter.cpp GridBox.h GridBox.cpp
GraphicProvider.cpp LightDisplaySkinlet.h LightDisplaySkinlet.cpp
GridBox.cpp LightDisplay.h LightDisplay.cpp
LightDisplaySkinlet.cpp DashboardPage.h DashboardPage.cpp
LightDisplay.cpp DevicesPage.h DevicesPage.cpp
MainItem.cpp MainItem.h MainItem.cpp
MainWindow.cpp MainWindow.h MainWindow.cpp
MenuBar.cpp MembersPage.h MembersPage.cpp
MembersPage.cpp MenuBar.h MenuBar.cpp
MyDevices.cpp MyDevices.h MyDevices.cpp
RoomsPage.cpp RoomsPage.h RoomsPage.cpp
RoundedIcon.cpp RoundedIcon.h RoundedIcon.cpp
Skin.cpp Skin.h Skin.cpp
StatisticsPage.cpp StatisticsPage.h StatisticsPage.cpp
TopBar.cpp TopBar.h TopBar.cpp
RoundButton.cpp RoundButton.h RoundButton.cpp
UsageBox.cpp UsageBox.h UsageBox.cpp
UsageDiagram.cpp UsageDiagram.h UsageDiagram.cpp
StoragePage.cpp StoragePage.h StoragePage.cpp
StorageMeter.cpp StorageMeter.h StorageMeter.cpp
StorageBar.cpp StorageBar.h StorageBar.cpp
StorageBarSkinlet.cpp StorageBarSkinlet.h StorageBarSkinlet.cpp
main.cpp) nodes/DiagramDataNode.h nodes/DiagramDataNode.cpp
nodes/DiagramSegmentsNode.h nodes/DiagramSegmentsNode.cpp
nodes/RadialTickmarksNode.cpp nodes/RadialTickmarksNode.h
main.cpp
)
qt_add_resources(SOURCES images.qrc fonts.qrc)
list(APPEND SOURCES qsk_add_example(iotdashboard ${SOURCES})
nodes/DiagramDataNode.cpp
nodes/DiagramSegmentsNode.cpp
nodes/RadialTickmarksNode.cpp)
list(APPEND HEADERS
Box.h
BoxWithButtons.h
CircularProgressBar.h
CircularProgressBarSkinlet.h
Diagram.h
DiagramSkinlet.h
EnergyMeter.h
GraphicProvider.h
GridBox.h
LightDisplaySkinlet.h
LightDisplay.h
DashboardPage.h
DevicesPage.h
MainItem.h
MainWindow.h
MembersPage.h
MenuBar.h
MyDevices.h
RoomsPage.h
RoundedIcon.h
Skin.h
StatisticsPage.h
TopBar.h
RoundButton.h
UsageBox.h
UsageDiagram.h
StoragePage.h
StorageMeter.h
StorageBar.h
StorageBarSkinlet.h)
list(APPEND HEADERS
nodes/DiagramDataNode.h
nodes/DiagramSegmentsNode.h
nodes/RadialTickmarksNode.h)
qsk_add_example(iotdashboard)

View File

@ -1,22 +1,18 @@
list(APPEND RESOURCES layouts.qrc) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND HEADERS set(SOURCES
TestRectangle.h TestRectangle.h TestRectangle.cpp
ButtonBox.h ButtonBox.h ButtonBox.cpp
FlowLayoutPage.h FlowLayoutPage.h FlowLayoutPage.cpp
GridLayoutPage.h GridLayoutPage.h GridLayoutPage.cpp
LinearLayoutPage.h LinearLayoutPage.h LinearLayoutPage.cpp
DynamicConstraintsPage.h DynamicConstraintsPage.h DynamicConstraintsPage.cpp
StackLayoutPage.h) StackLayoutPage.h StackLayoutPage.cpp
main.cpp
)
qt_add_resources(SOURCES layouts.qrc)
list(APPEND SOURCES qsk_add_example(layouts ${SOURCES})
TestRectangle.cpp
ButtonBox.cpp
FlowLayoutPage.cpp
GridLayoutPage.cpp
LinearLayoutPage.cpp
DynamicConstraintsPage.cpp
StackLayoutPage.cpp
main.cpp)
qsk_add_example(layouts)

View File

@ -1,3 +1,6 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(listbox) qsk_add_example(listbox main.cpp)

View File

@ -1,3 +1,6 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(messagebox) qsk_add_example(messagebox main.cpp)

View File

@ -1,4 +1,9 @@
list(APPEND RESSOURCES messagebox.qrc) ############################################################################
list(APPEND SOURCES main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(messageboxQml) set(SOURCES main.cpp)
qt_add_resources(SOURCES messagebox.qrc)
qsk_add_example(messageboxQml ${SOURCES})

View File

@ -1,12 +1,11 @@
list(APPEND SOURCES ############################################################################
MySkin.cpp # QSkinny - Copyright (C) 2016 Uwe Rathmann
MyToggleButton.cpp # This file may be used under the terms of the 3-clause BSD License
MyToggleButtonSkinlet.cpp ############################################################################
main.cpp)
list(APPEND HEADERS qsk_add_example(mycontrols
MyToggleButton.h MySkin.h MySkin.cpp
MyToggleButtonSkinlet.h MyToggleButton.h MyToggleButton.cpp
MySkin.h) MyToggleButtonSkinlet.h MyToggleButtonSkinlet.cpp
main.cpp
qsk_add_example(mycontrols) )

View File

@ -1,11 +1,9 @@
list(APPEND HEADERS ############################################################################
MainWindow.h) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND SOURCES set(SOURCES MainWindow.h MainWindow.cpp main.cpp)
MainWindow.cpp qt_add_resources(SOURCES qvgviewer.qrc)
main.cpp)
list(APPEND RESOURCES qsk_add_example(qvgviewer ${SOURCES})
qvgviewer.qrc)
qsk_add_example(qvgviewer)

View File

@ -1,12 +1,11 @@
list(APPEND HEADERS ############################################################################
CustomSlider.h # QSkinny - Copyright (C) 2016 Uwe Rathmann
CustomSliderSkinlet.h # This file may be used under the terms of the 3-clause BSD License
OtherSlider.h) ############################################################################
list(APPEND SOURCES qsk_add_example(tabview
CustomSlider.cpp CustomSlider.h CustomSlider.cpp
CustomSliderSkinlet.cpp CustomSliderSkinlet.h CustomSliderSkinlet.cpp
OtherSlider.cpp OtherSlider.h OtherSlider.cpp
main.cpp) main.cpp
)
qsk_add_example(tabview)

View File

@ -1,3 +1,6 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(thumbnails) qsk_add_example(thumbnails main.cpp)

View File

@ -1,7 +1,7 @@
set(TARGET_NAME qskinputcontext) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
list(APPEND HEADERS QskInputContextGlobal.h) # This file may be used under the terms of the QSkinny License, Version 1.0
list(APPEND SOURCES QskInputContextPlugin.cpp) ############################################################################
if(NOT LINUX AND ENABLE_HUNSPELL) if(NOT LINUX AND ENABLE_HUNSPELL)
message(WARNING "Feature 'hunspell' only available for UNIX!") message(WARNING "Feature 'hunspell' only available for UNIX!")
@ -13,25 +13,28 @@ if(NOT LINUX AND ENABLE_PINYIN)
unset(ENABLE_PINYIN CACHE) unset(ENABLE_PINYIN CACHE)
endif() endif()
set(SOURCES QskInputContextGlobal.h QskInputContextPlugin.cpp)
if(ENABLE_PINYIN) if(ENABLE_PINYIN)
include("QSkinnyOptionalPinyin") include("QSkinnyOptionalPinyin")
list(APPEND HEADERS
${CMAKE_SOURCE_DIR}/src/inputpanel/QskPinyinTextPredictor.h)
list(APPEND SOURCES list(APPEND SOURCES
${CMAKE_SOURCE_DIR}/src/inputpanel/QskPinyinTextPredictor.cpp) ${CMAKE_SOURCE_DIR}/src/inputpanel/QskPinyinTextPredictor.h
${CMAKE_SOURCE_DIR}/src/inputpanel/QskPinyinTextPredictor.cpp
)
endif() endif()
if(ENABLE_HUNSPELL) if(ENABLE_HUNSPELL)
include("QSkinnyOptionalHunspell") include("QSkinnyOptionalHunspell")
list(APPEND HEADERS
${CMAKE_SOURCE_DIR}/src/inputpanel/QskHunspellTextPredictor.h)
list(APPEND SOURCES list(APPEND SOURCES
${CMAKE_SOURCE_DIR}/src/inputpanel/QskHunspellTextPredictor.cpp) ${CMAKE_SOURCE_DIR}/src/inputpanel/QskHunspellTextPredictor.h
${CMAKE_SOURCE_DIR}/src/inputpanel/QskHunspellTextPredictor.cpp
)
endif() endif()
qsk_add_plugin(qskinputcontext platforminputcontexts QskInputContextPlugin) qsk_add_plugin(qskinputcontext
platforminputcontexts QskInputContextPlugin ${SOURCES})
if(ENABLE_PINYIN) if(ENABLE_PINYIN)
target_link_libraries(qskinputcontext PRIVATE pinyin Fcitx5::Utils) target_link_libraries(qskinputcontext PRIVATE pinyin Fcitx5::Utils)

View File

@ -1,21 +1,15 @@
list(APPEND HEADERS ############################################################################
kiwi/Constraint.h # QSkinny - Copyright (C) 2016 Uwe Rathmann
kiwi/Expression.h # This file may be used under the terms of the 3-clause BSD License
kiwi/Solver.h ############################################################################
kiwi/Strength.h
kiwi/Term.h
kiwi/Variable.h)
list(APPEND SOURCES set(SOURCES
kiwi/Expression.cpp kiwi/Strength.h kiwi/Term.h kiwi/Variable.h
kiwi/Constraint.cpp kiwi/Constraint.h kiwi/Constraint.cpp
kiwi/Solver.cpp) kiwi/Expression.h kiwi/Expression.cpp
kiwi/Solver.h kiwi/Solver.cpp
AnchorBox.h AnchorBox.cpp
main.cpp
)
list(APPEND HEADERS qsk_add_example(anchors ${SOURCES})
AnchorBox.h)
list(APPEND SOURCES
AnchorBox.cpp
main.cpp)
qsk_add_example(anchors)

View File

@ -1,4 +1,6 @@
list(APPEND HEADERS Window.h) ############################################################################
list(APPEND SOURCES Window.cpp main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(dialogbuttons) qsk_add_example(dialogbuttons Window.h Window.cpp main.cpp)

View File

@ -1,16 +1,15 @@
list(APPEND RESOURCES images.qrc) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND HEADERS set(SOURCES
SkinFactory.h SkinFactory.h SkinFactory.cpp
Dial.h Dial.h Dial.cpp
DialSkinlet.h DialSkinlet.h DialSkinlet.cpp
Dashboard.h) Dashboard.h Dashboard.cpp
main.cpp
)
qt_add_resources(SOURCES images.qrc)
list(APPEND SOURCES qsk_add_example(dials ${SOURCES})
SkinFactory.cpp
Dial.cpp
DialSkinlet.cpp
Dashboard.cpp
main.cpp)
qsk_add_example(dials)

View File

@ -1,14 +1,15 @@
list(APPEND HEADERS GradientView.h) ############################################################################
list(APPEND SOURCES GradientView.cpp main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
set(SOURCES GradientView.h GradientView.cpp main.cpp)
if(TARGET quickshapes_private) if(TARGET quickshapes_private)
list(APPEND SOURCES GradientQuickShape.h GradientQuickShape.cpp)
list(APPEND SOURCES GradientQuickShape.cpp)
list(APPEND HEADERS GradientQuickShape.cpp)
endif() endif()
qsk_add_example(gradients) qsk_add_example(gradients ${SOURCES})
if(TARGET quickshapes_private) if(TARGET quickshapes_private)
target_compile_definitions(gradients PRIVATE SHAPE_GRADIENT) target_compile_definitions(gradients PRIVATE SHAPE_GRADIENT)

View File

@ -1,20 +1,18 @@
list(APPEND HEADERS ############################################################################
GridAccessor.h # QSkinny - Copyright (C) 2016 Uwe Rathmann
GridSkinny.h # This file may be used under the terms of the 3-clause BSD License
GridWidgets.h ############################################################################
GridGraphics.h
GridQuick.h
TestBox.h)
list(APPEND SOURCES set(SOURCES
GridAccessor.cpp GridAccessor.h GridAccessor.cpp
GridSkinny.cpp GridSkinny.h GridSkinny.cpp
GridWidgets.cpp GridWidgets.h GridWidgets.cpp
GridGraphics.cpp GridGraphics.h GridGraphics.cpp
GridQuick.cpp GridQuick.h GridQuick.cpp
TestBox.cpp TestBox.h TestBox.cpp
main.cpp) main.cpp
)
qsk_add_example(grids) qsk_add_example(grids ${SOURCES})
target_link_libraries(grids PRIVATE Qt::QuickWidgets) target_link_libraries(grids PRIVATE Qt::QuickWidgets)

View File

@ -1,5 +1,9 @@
list(APPEND RESOURCES images.qrc) ############################################################################
list(APPEND HEADERS Image.h) # QSkinny - Copyright (C) 2016 Uwe Rathmann
list(APPEND SOURCES Image.cpp main.cpp) # This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(images) set(SOURCES Image.h Image.cpp main.cpp)
qt_add_resources(SOURCES images.qrc)
qsk_add_example(images ${SOURCES})

View File

@ -1,3 +1,6 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(inputpanel) qsk_add_example(inputpanel main.cpp)

View File

@ -1,6 +1,8 @@
list(APPEND HEADERS Callback.h Invoker.h) ############################################################################
list(APPEND SOURCES Callback.cpp Invoker.cpp main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(invoker) qsk_add_example(invoker Callback.h Callback.cpp Invoker.h Invoker.cpp main.cpp)
set_target_properties(invoker PROPERTIES AUTOMOC_MOC_OPTIONS --no-warnings) set_target_properties(invoker PROPERTIES AUTOMOC_MOC_OPTIONS --no-warnings)

View File

@ -1,4 +1,6 @@
list(APPEND HEADERS ShadowedBox.h) ############################################################################
list(APPEND SOURCES ShadowedBox.cpp main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(shadows) qsk_add_example(shadows ShadowedBox.h ShadowedBox.cpp main.cpp)

View File

@ -1,22 +1,22 @@
list(APPEND HEADERS ############################################################################
ShapeItem.h # QSkinny - Copyright (C) 2016 Uwe Rathmann
GeometricShape.h # This file may be used under the terms of the 3-clause BSD License
Window.h ############################################################################
Stroke.h)
list(APPEND SOURCES set(SOURCES
Stroke.cpp ShapeItem.h ShapeItem.cpp
ShapeItem.cpp GeometricShape.h GeometricShape.cpp
GeometricShape.cpp Stroke.h Stroke.cpp
Window.cpp Window.h Window.cpp
main.cpp) main.cpp
)
if( BUILD_QML_EXPORT ) if( BUILD_QML_EXPORT )
list(APPEND RESOURCES shapes.qrc) qt_add_resources(SOURCES shapes.qrc)
endif() endif()
qsk_add_example(shapes) qsk_add_example(shapes ${SOURCES})
if( BUILD_QML_EXPORT ) if( NOT BUILD_QML_EXPORT )
target_compile_definitions(shapes PRIVATE NO_QML) target_compile_definitions(shapes PRIVATE NO_QML)
endif() endif()

View File

@ -1,6 +1,9 @@
list(APPEND SOURCES main.cpp) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
qsk_add_example(webview) qsk_add_example(webview main.cpp)
if (QT_VERSION_MAJOR VERSION_GREATER "5") if (QT_VERSION_MAJOR VERSION_GREATER "5")
target_link_libraries(webview PRIVATE Qt::WebEngineQuick Qt::WebEngineQuickPrivate) target_link_libraries(webview PRIVATE Qt::WebEngineQuick Qt::WebEngineQuickPrivate)

View File

@ -1,32 +1,19 @@
set(TARGET_NAME qskqmlexport) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
list(APPEND TARGET_HEADERS set(HEADERS QskQmlGlobal.h QskShortcutQml.h QskLayoutQml.h QskMainQml.h QskQml.h)
QskQmlGlobal.h set(SOURCES QskShortcutQml.cpp QskLayoutQml.cpp QskMainQml.cpp QskQml.cpp)
QskShortcutQml.h
QskLayoutQml.h
QskMainQml.h
QskQml.h)
list(APPEND TARGET_SOURCES set(target qskqmlexport)
QskShortcutQml.cpp qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
QskLayoutQml.cpp
QskMainQml.cpp
QskQml.cpp)
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS}) target_link_libraries(${target} PRIVATE qskinny)
target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(${TARGET_NAME}
PRIVATE
qskinny)
target_include_directories(${TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR})
if(BUILD_QSKDLL) if(BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${target} PRIVATE QSK_QML_MAKEDLL)
PRIVATE
QSK_QML_MAKEDLL)
endif() endif()
install(TARGETS ${TARGET_NAME} DESTINATION qmlexport) install(TARGETS ${target} DESTINATION qmlexport)

View File

@ -1,15 +1,13 @@
set(QSK_PLUGIN_SUBDIR skins) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
list(APPEND HEADERS set(SOURCES
QskMaterial3Global.h QskMaterial3Global.h QskMaterial3Skin.h QskMaterial3Skin.cpp
QskMaterial3Skin.h QskMaterial3SkinFactory.h QskMaterial3SkinFactory.cpp
QskMaterial3SkinFactory.h) )
qt_add_resources(SOURCES icons.qrc)
list(APPEND SOURCES qsk_add_plugin(material3skin skins QskMaterial3SkinFactory ${SOURCES})
QskMaterial3Skin.cpp
QskMaterial3SkinFactory.cpp)
list(APPEND RESOURCES icons.qrc )
qsk_add_plugin(material3skin skins QskMaterial3SkinFactory)
target_compile_definitions(material3skin PRIVATE QSK_MATERIAL3_MAKEDLL) target_compile_definitions(material3skin PRIVATE QSK_MATERIAL3_MAKEDLL)

View File

@ -1,13 +1,10 @@
set(QSK_PLUGIN_SUBDIR skins) ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
list(APPEND HEADERS qsk_add_plugin(squiekskin skins QskSquiekSkinFactory
QskSquiekGlobal.h QskSquiekGlobal.h QskSquiekSkin.h QskSquiekSkin.cpp
QskSquiekSkin.h QskSquiekSkinFactory.h QskSquiekSkinFactory.cpp
QskSquiekSkinFactory.h) )
list(APPEND SOURCES
QskSquiekSkin.cpp
QskSquiekSkinFactory.cpp)
qsk_add_plugin(squiekskin skins QskSquiekSkinFactory)
target_compile_definitions(squiekskin PRIVATE QSK_SQUIEK_MAKEDLL) target_compile_definitions(squiekskin PRIVATE QSK_SQUIEK_MAKEDLL)

View File

@ -1,6 +1,11 @@
############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
include(${CMAKE_SOURCE_DIR}/cmake/QSkinnyMacros.cmake) include(${CMAKE_SOURCE_DIR}/cmake/QSkinnyMacros.cmake)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
common/QskArcMetrics.h common/QskArcMetrics.h
common/QskAspect.h common/QskAspect.h
common/QskBoxBorderColors.h common/QskBoxBorderColors.h
@ -30,9 +35,10 @@ list(APPEND TARGET_HEADERS
common/QskSizePolicy.h common/QskSizePolicy.h
common/QskStateCombination.h common/QskStateCombination.h
common/QskTextColors.h common/QskTextColors.h
common/QskTextOptions.h) common/QskTextOptions.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
common/QskArcMetrics.cpp common/QskArcMetrics.cpp
common/QskAspect.cpp common/QskAspect.cpp
common/QskBoxBorderColors.cpp common/QskBoxBorderColors.cpp
@ -58,9 +64,10 @@ list(APPEND TARGET_SOURCES
common/QskShadowMetrics.cpp common/QskShadowMetrics.cpp
common/QskSizePolicy.cpp common/QskSizePolicy.cpp
common/QskTextColors.cpp common/QskTextColors.cpp
common/QskTextOptions.cpp) common/QskTextOptions.cpp
)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
graphic/QskColorFilter.h graphic/QskColorFilter.h
graphic/QskGraphic.h graphic/QskGraphic.h
graphic/QskGraphicImageProvider.h graphic/QskGraphicImageProvider.h
@ -71,9 +78,10 @@ list(APPEND TARGET_HEADERS
graphic/QskGraphicTextureFactory.h graphic/QskGraphicTextureFactory.h
graphic/QskIcon.h graphic/QskIcon.h
graphic/QskPainterCommand.h graphic/QskPainterCommand.h
graphic/QskStandardSymbol.h) graphic/QskStandardSymbol.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
graphic/QskColorFilter.cpp graphic/QskColorFilter.cpp
graphic/QskGraphic.cpp graphic/QskGraphic.cpp
graphic/QskGraphicImageProvider.cpp graphic/QskGraphicImageProvider.cpp
@ -84,9 +92,10 @@ list(APPEND TARGET_SOURCES
graphic/QskGraphicTextureFactory.cpp graphic/QskGraphicTextureFactory.cpp
graphic/QskIcon.cpp graphic/QskIcon.cpp
graphic/QskPainterCommand.cpp graphic/QskPainterCommand.cpp
graphic/QskStandardSymbol.cpp) graphic/QskStandardSymbol.cpp
)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
nodes/QskArcNode.h nodes/QskArcNode.h
nodes/QskArcRenderer.h nodes/QskArcRenderer.h
nodes/QskBoxNode.h nodes/QskBoxNode.h
@ -113,9 +122,10 @@ list(APPEND TARGET_HEADERS
nodes/QskTextRenderer.h nodes/QskTextRenderer.h
nodes/QskTextureRenderer.h nodes/QskTextureRenderer.h
nodes/QskTickmarksNode.h nodes/QskTickmarksNode.h
nodes/QskVertex.h) nodes/QskVertex.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
nodes/QskArcNode.cpp nodes/QskArcNode.cpp
nodes/QskArcRenderer.cpp nodes/QskArcRenderer.cpp
nodes/QskBoxNode.cpp nodes/QskBoxNode.cpp
@ -142,12 +152,12 @@ list(APPEND TARGET_SOURCES
nodes/QskTextRenderer.cpp nodes/QskTextRenderer.cpp
nodes/QskTextureRenderer.cpp nodes/QskTextureRenderer.cpp
nodes/QskTickmarksNode.cpp nodes/QskTickmarksNode.cpp
nodes/QskVertex.cpp) nodes/QskVertex.cpp
)
list(APPEND TARGET_RESSOURCES qt_add_resources(SOURCES nodes/shaders.qrc)
nodes/shaders.qrc)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
controls/QskAbstractButton.h controls/QskAbstractButton.h
controls/QskAnimationHint.h controls/QskAnimationHint.h
controls/QskAnimator.h controls/QskAnimator.h
@ -236,9 +246,10 @@ list(APPEND TARGET_HEADERS
controls/QskTextLabel.h controls/QskTextLabel.h
controls/QskTextLabelSkinlet.h controls/QskTextLabelSkinlet.h
controls/QskVariantAnimator.h controls/QskVariantAnimator.h
controls/QskWindow.h) controls/QskWindow.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
controls/QskAbstractButton.cpp controls/QskAbstractButton.cpp
controls/QskAnimator.cpp controls/QskAnimator.cpp
controls/QskAnimationHint.cpp controls/QskAnimationHint.cpp
@ -326,9 +337,10 @@ list(APPEND TARGET_SOURCES
controls/QskTextLabel.cpp controls/QskTextLabel.cpp
controls/QskTextLabelSkinlet.cpp controls/QskTextLabelSkinlet.cpp
controls/QskVariantAnimator.cpp controls/QskVariantAnimator.cpp
controls/QskWindow.cpp) controls/QskWindow.cpp
)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
layouts/QskGridBox.h layouts/QskGridBox.h
layouts/QskGridLayoutEngine.h layouts/QskGridLayoutEngine.h
layouts/QskIndexedLayoutBox.h layouts/QskIndexedLayoutBox.h
@ -340,9 +352,10 @@ list(APPEND TARGET_HEADERS
layouts/QskLinearLayoutEngine.h layouts/QskLinearLayoutEngine.h
layouts/QskStackBoxAnimator.h layouts/QskStackBoxAnimator.h
layouts/QskStackBox.h layouts/QskStackBox.h
layouts/QskSubcontrolLayoutEngine.h) layouts/QskSubcontrolLayoutEngine.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
layouts/QskGridBox.cpp layouts/QskGridBox.cpp
layouts/QskGridLayoutEngine.cpp layouts/QskGridLayoutEngine.cpp
layouts/QskIndexedLayoutBox.cpp layouts/QskIndexedLayoutBox.cpp
@ -354,9 +367,10 @@ list(APPEND TARGET_SOURCES
layouts/QskLinearLayoutEngine.cpp layouts/QskLinearLayoutEngine.cpp
layouts/QskStackBoxAnimator.cpp layouts/QskStackBoxAnimator.cpp
layouts/QskStackBox.cpp layouts/QskStackBox.cpp
layouts/QskSubcontrolLayoutEngine.cpp) layouts/QskSubcontrolLayoutEngine.cpp
)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
dialogs/QskDialog.h dialogs/QskDialog.h
dialogs/QskDialogButton.h dialogs/QskDialogButton.h
dialogs/QskDialogButtonBox.h dialogs/QskDialogButtonBox.h
@ -365,9 +379,10 @@ list(APPEND TARGET_HEADERS
dialogs/QskMessageSubWindow.h dialogs/QskMessageSubWindow.h
dialogs/QskMessageWindow.h dialogs/QskMessageWindow.h
dialogs/QskSelectionSubWindow.h dialogs/QskSelectionSubWindow.h
dialogs/QskSelectionWindow.h) dialogs/QskSelectionWindow.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
dialogs/QskDialogButton.cpp dialogs/QskDialogButton.cpp
dialogs/QskDialogButtonBox.cpp dialogs/QskDialogButtonBox.cpp
dialogs/QskDialog.cpp dialogs/QskDialog.cpp
@ -376,112 +391,86 @@ list(APPEND TARGET_SOURCES
dialogs/QskMessageSubWindow.cpp dialogs/QskMessageSubWindow.cpp
dialogs/QskMessageWindow.cpp dialogs/QskMessageWindow.cpp
dialogs/QskSelectionSubWindow.cpp dialogs/QskSelectionSubWindow.cpp
dialogs/QskSelectionWindow.cpp) dialogs/QskSelectionWindow.cpp
)
list(APPEND TARGET_HEADERS list(APPEND HEADERS
inputpanel/QskTextPredictor.h inputpanel/QskTextPredictor.h
inputpanel/QskInputContext.h inputpanel/QskInputContext.h
inputpanel/QskInputPanel.h inputpanel/QskInputPanel.h
inputpanel/QskInputPanelBox.h inputpanel/QskInputPanelBox.h
inputpanel/QskInputPredictionBar.h inputpanel/QskInputPredictionBar.h
inputpanel/QskVirtualKeyboard.h) inputpanel/QskVirtualKeyboard.h
)
list(APPEND TARGET_SOURCES list(APPEND SOURCES
inputpanel/QskTextPredictor.cpp inputpanel/QskTextPredictor.cpp
inputpanel/QskInputContext.cpp inputpanel/QskInputContext.cpp
inputpanel/QskInputPanel.cpp inputpanel/QskInputPanel.cpp
inputpanel/QskInputPanelBox.cpp inputpanel/QskInputPanelBox.cpp
inputpanel/QskInputPredictionBar.cpp inputpanel/QskInputPredictionBar.cpp
inputpanel/QskVirtualKeyboard.cpp) inputpanel/QskVirtualKeyboard.cpp
)
if(ENABLE_PINYIN) if(ENABLE_PINYIN)
list(APPEND TARGET_HEADERS list(APPEND HEADERS inputpanel/QskPinyinTextPredictor.h)
inputpanel/QskPinyinTextPredictor.h) list(APPEND SOURCES inputpanel/QskPinyinTextPredictor.cpp)
list(APPEND TARGET_SOURCES
inputpanel/QskPinyinTextPredictor.cpp)
endif() endif()
if(ENABLE_HUNSPELL) if(ENABLE_HUNSPELL)
list(APPEND TARGET_HEADERS list(APPEND HEADERS inputpanel/QskHunspellTextPredictor.h)
inputpanel/QskHunspellTextPredictor.h) list(APPEND SOURCES inputpanel/QskHunspellTextPredictor.cpp)
list(APPEND TARGET_SOURCES
inputpanel/QskHunspellTextPredictor.cpp)
endif() endif()
set(TARGET_NAME qskinny) set(target qskinny)
if(BUILD_QSKDLL) if(BUILD_QSKDLL)
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESSOURCES}) qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
else() else()
qsk_add_library(${TARGET_NAME} STATIC ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESSOURCES}) qsk_add_library(${target} STATIC ${SOURCES} ${HEADERS})
endif() endif()
if(BUILD_QSKDLL) if(BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${target} PUBLIC QSK_DLL PRIVATE QSK_MAKEDLL)
PUBLIC
QSK_DLL
PRIVATE
QSK_MAKEDLL)
endif() endif()
target_include_directories(${TARGET_NAME} target_include_directories(${target} PUBLIC
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/dialogs>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/dialogs> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphic>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/graphic> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/inputpanel>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/inputpanel> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/layouts>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/layouts> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes>)
target_include_directories(${TARGET_NAME} target_include_directories(${target}
INTERFACE INTERFACE $<INSTALL_INTERFACE:${QSK_INSTALL_HEADERS}>)
$<INSTALL_INTERFACE:${QSK_INSTALL_HEADERS}>)
target_link_libraries(${TARGET_NAME} target_link_libraries(${target}
PUBLIC PUBLIC Qt::Core Qt::CorePrivate Qt::Quick Qt::QuickPrivate)
Qt::Core
Qt::CorePrivate
Qt::Quick
Qt::QuickPrivate)
if (QT_VERSION_MAJOR VERSION_GREATER "5") if (QT_VERSION_MAJOR VERSION_GREATER "5")
target_link_libraries(${TARGET_NAME} target_link_libraries(${target}
PUBLIC PUBLIC Qt::OpenGL Qt::OpenGLPrivate)
Qt::OpenGL
Qt::OpenGLPrivate)
endif() endif()
if(ENABLE_HUNSPELL) if(ENABLE_HUNSPELL)
target_link_libraries(${TARGET_NAME} target_link_libraries(${target} PRIVATE hunspell)
PRIVATE
hunspell)
endif() endif()
if(ENABLE_PINYIN) if(ENABLE_PINYIN)
target_compile_definitions(${TARGET_NAME} PRIVATE PINYIN) target_compile_definitions(${target} PRIVATE PINYIN)
target_link_libraries(${target} PRIVATE pinyin Fcitx5::Utils)
target_link_libraries(${TARGET_NAME} target_include_directories(${target}
PRIVATE PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/inputcontext>)
pinyin
Fcitx5::Utils)
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/inputcontext>)
endif() endif()
set_target_properties(${TARGET_NAME} set_target_properties(${target} PROPERTIES FOLDER libs)
PROPERTIES
FOLDER libs)
# TODO hack for standalone qvg2svg # TODO hack for standalone qvg2svg
set_target_properties(${TARGET_NAME} set_target_properties(${target}
PROPERTIES PROPERTIES AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
list(TRANSFORM TARGET_HEADERS PREPEND "${CMAKE_CURRENT_LIST_DIR}/") list(TRANSFORM HEADERS PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
set_target_properties(${TARGET_NAME} set_target_properties(${target} PROPERTIES PUBLIC_HEADER "${HEADERS}")
PROPERTIES
PUBLIC_HEADER "${TARGET_HEADERS}")

View File

@ -1,22 +1,22 @@
list(APPEND TARGET_HEADERS ############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
set(SOURCES
SkinnyGlobal.h SkinnyGlobal.h
SkinnyNamespace.h SkinnyNamespace.h SkinnyNamespace.cpp
SkinnyShapeFactory.h SkinnyShapeFactory.h SkinnyShapeFactory.cpp
SkinnyShapeProvider.h SkinnyShapeProvider.h SkinnyShapeProvider.cpp
SkinnyShortcut.h) SkinnyShortcut.h SkinnyShortcut.cpp
)
list(APPEND TARGET_SOURCES set(target qsktestsupport)
SkinnyNamespace.cpp
SkinnyShapeFactory.cpp
SkinnyShapeProvider.cpp
SkinnyShortcut.cpp)
set(TARGET_NAME qsktestsupport)
if (BUILD_QSKDLL) if (BUILD_QSKDLL)
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS}) qsk_add_library(${target} SHARED ${SOURCES})
else() else()
qsk_add_library(${TARGET_NAME} STATIC ${TARGET_SOURCES} ${TARGET_HEADERS}) qsk_add_library(${target} STATIC ${SOURCES})
endif() endif()
set(HACK_FONT_CONFIG ON) set(HACK_FONT_CONFIG ON)
@ -38,32 +38,29 @@ if(HACK_FONT_CONFIG)
@ONLY @ONLY
NEWLINE_STYLE LF) NEWLINE_STYLE LF)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${target}
PRIVATE PRIVATE FONTCONFIG_FILE=${QSK_FONTCONF_FILE})
FONTCONFIG_FILE=${QSK_FONTCONF_FILE})
endif() endif()
target_link_libraries(${TARGET_NAME} PUBLIC qskinny) target_link_libraries(${target} PUBLIC qskinny)
if (BUILD_QSKDLL) if (BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME} PRIVATE SKINNY_MAKEDLL) target_compile_definitions(${target} PRIVATE SKINNY_MAKEDLL)
endif() endif()
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${target}
PRIVATE PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins) PRIVATE PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_LIST_DIR})
if(ENABLE_ENSURE_SKINS) if(ENABLE_ENSURE_SKINS)
#set( ENABLE_ENSURE_SKINS OFF ) #set( ENABLE_ENSURE_SKINS OFF )
endif() endif()
if(ENABLE_ENSURE_SKINS) if(ENABLE_ENSURE_SKINS)
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/skins) target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
target_compile_definitions(${TARGET_NAME} PRIVATE ENSURE_SKINS) target_compile_definitions(${target} PRIVATE ENSURE_SKINS)
target_link_libraries(${target} PRIVATE squiekskin material3skin)
target_link_libraries(${TARGET_NAME}
PRIVATE squiekskin material3skin)
endif() endif()
install(TARGETS ${TARGET_NAME} DESTINATION ${QSK_INSTALL_LIBS}) install(TARGETS ${target} DESTINATION ${QSK_INSTALL_LIBS})

View File

@ -1,14 +1,17 @@
set(TARGET_NAME svg2qvg) ############################################################################
set(TARGET_SOURCES main.cpp) # QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the QSkinny License, Version 1.0
############################################################################
qsk_add_executable(${TARGET_NAME} ${TARGET_SOURCES}) set(target svg2qvg)
qsk_add_executable(${target} main.cpp)
if(BUILD_SVG2QVG_STANDALONE) if(BUILD_SVG2QVG_STANDALONE)
# NOTE: when building standalone some moc files are transitively required. # NOTE: when building standalone some moc files are transitively required.
# These files are being created by the qskinny build, hence we add an explicit dependency. # These files are being created by the qskinny build, hence we add an explicit dependency.
# E.g. main.cpp -> #include <QskGraphic.cpp> -> #include "moc_QskGraphic.cpp" # E.g. main.cpp -> #include <QskGraphic.cpp> -> #include "moc_QskGraphic.cpp"
add_dependencies(${TARGET_NAME} qskinny) add_dependencies(${target} qskinny)
# TODO hack for standalone qvg2svg # TODO hack for standalone qvg2svg
get_target_property(qskinny_AUTOGEN_DIR qskinny AUTOGEN_BUILD_DIR) get_target_property(qskinny_AUTOGEN_DIR qskinny AUTOGEN_BUILD_DIR)
@ -20,34 +23,20 @@ if(BUILD_SVG2QVG_STANDALONE)
if(CMAKE_GENERATOR MATCHES "Visual Studio.*") if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
add_definitions("/I${qskinny_AUTOGEN_DIR}/include_\$(Configuration)") add_definitions("/I${qskinny_AUTOGEN_DIR}/include_\$(Configuration)")
else() else()
target_include_directories(${TARGET_NAME} target_include_directories(${target} PRIVATE ${qskinny_AUTOGEN_DIR}/include)
PRIVATE
${qskinny_AUTOGEN_DIR}/include)
endif() endif()
target_include_directories(${TARGET_NAME} target_include_directories(${target}
PRIVATE PRIVATE
${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/common
${CMAKE_SOURCE_DIR}/src/graphic) ${CMAKE_SOURCE_DIR}/src/graphic)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${target} PRIVATE QSK_STANDALONE)
PRIVATE target_link_libraries(${target} PRIVATE Qt::Gui Qt::GuiPrivate)
QSK_STANDALONE)
target_link_libraries(${TARGET_NAME}
PRIVATE
Qt::Gui
Qt::GuiPrivate
Qt::Svg)
else()
target_link_libraries(${TARGET_NAME}
PRIVATE
qskinny
Qt::Svg)
endif() endif()
set_target_properties(${TARGET_NAME} target_link_libraries(${target} PRIVATE qskinny Qt::Svg)
PROPERTIES
FOLDER tools)
install(TARGETS ${TARGET_NAME}) set_target_properties(${target} PROPERTIES FOLDER tools)
install(TARGETS ${target})