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)
## @param SVG_FILENAME absolute filename to the svg
## @param QVG_FILENAME absolute filename to the qvg
@ -13,7 +18,7 @@ if(TARGET ${Qt}::Svg)
endfunction()
endif()
function(qsk_add_executable)
function(qsk_add_executable target)
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_executable(${ARGV})
@ -21,9 +26,12 @@ function(qsk_add_executable)
add_executable(${ARGV})
endif()
set_target_properties(${target} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" )
endfunction()
function(qsk_add_library)
function(qsk_add_library target)
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_library(${ARGV})
@ -31,12 +39,14 @@ function(qsk_add_library)
add_library(${ARGV})
endif()
set_target_properties(${TARGET_NAME} PROPERTIES
set_target_properties(${target} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
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
# 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 factories only. TODO ...
# 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)
qt6_add_library(${PLUGIN_NAME} SHARED )
qt6_add_library(${target} SHARED )
else()
add_library(${PLUGIN_NAME} SHARED )
add_library(${target} SHARED )
endif()
set_target_properties(${PLUGIN_NAME} PROPERTIES
set_target_properties(${target} PROPERTIES
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_link_libraries(${PLUGIN_NAME} PRIVATE qskinny)
target_sources( ${target} PRIVATE ${arg_UNPARSED_ARGUMENTS} )
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}/
# 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}")
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
${SOURCES} ${HEADERS} ${RESOURCES})
qsk_add_executable(${target} WIN32 MACOSX_BUNDLE ${arg_UNPARSED_ARGUMENTS} )
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 )
target_link_libraries(${TARGET_NAME} PRIVATE qskinny )
target_link_libraries(${target} PRIVATE qskinny )
# not all examples need this one. TODO ...
target_link_libraries(${TARGET_NAME} PRIVATE qsktestsupport)
target_link_libraries(${target} PRIVATE qsktestsupport)
if( BUILD_QML_EXPORT )
# Only needed, when having QML files. Autodetections is possible
# by looking into all '*.qrc' files ( rcc --list *.qrc ) for *.qml
# entries TODO ...
target_link_libraries(${TARGET_NAME} PRIVATE qskqmlexport)
target_link_libraries(${target} PRIVATE qskqmlexport)
endif()
# for examples with subdirectories
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
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)
list(APPEND SOURCES Frame.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(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
label/LabelPage.h
inputs/InputPage.h
progressbar/ProgressBarPage.h
button/ButtonPage.h
selector/SelectorPage.h
dialog/DialogPage.h
Page.h)
set(SOURCES
label/LabelPage.h label/LabelPage.cpp
inputs/InputPage.h inputs/InputPage.cpp
progressbar/ProgressBarPage.h progressbar/ProgressBarPage.cpp
button/ButtonPage.h button/ButtonPage.cpp
selector/SelectorPage.h selector/SelectorPage.cpp
dialog/DialogPage.h dialog/DialogPage.cpp
Page.h Page.cpp
main.cpp
)
qt_add_resources(SOURCES icons.qrc)
list(APPEND 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 ${SOURCES})
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
Box.cpp
BoxWithButtons.cpp
CircularProgressBar.cpp
CircularProgressBarSkinlet.cpp
DashboardPage.cpp
DevicesPage.cpp
Diagram.cpp
DiagramSkinlet.cpp
EnergyMeter.cpp
GraphicProvider.cpp
GridBox.cpp
LightDisplaySkinlet.cpp
LightDisplay.cpp
MainItem.cpp
MainWindow.cpp
MenuBar.cpp
MembersPage.cpp
MyDevices.cpp
RoomsPage.cpp
RoundedIcon.cpp
Skin.cpp
StatisticsPage.cpp
TopBar.cpp
RoundButton.cpp
UsageBox.cpp
UsageDiagram.cpp
StoragePage.cpp
StorageMeter.cpp
StorageBar.cpp
StorageBarSkinlet.cpp
main.cpp)
set(SOURCES
Box.h Box.cpp
BoxWithButtons.h BoxWithButtons.cpp
CircularProgressBar.h CircularProgressBar.cpp
CircularProgressBarSkinlet.h CircularProgressBarSkinlet.cpp
Diagram.h Diagram.cpp
DiagramSkinlet.h DiagramSkinlet.cpp
EnergyMeter.h EnergyMeter.cpp
GraphicProvider.h GraphicProvider.cpp
GridBox.h GridBox.cpp
LightDisplaySkinlet.h LightDisplaySkinlet.cpp
LightDisplay.h LightDisplay.cpp
DashboardPage.h DashboardPage.cpp
DevicesPage.h DevicesPage.cpp
MainItem.h MainItem.cpp
MainWindow.h MainWindow.cpp
MembersPage.h MembersPage.cpp
MenuBar.h MenuBar.cpp
MyDevices.h MyDevices.cpp
RoomsPage.h RoomsPage.cpp
RoundedIcon.h RoundedIcon.cpp
Skin.h Skin.cpp
StatisticsPage.h StatisticsPage.cpp
TopBar.h TopBar.cpp
RoundButton.h RoundButton.cpp
UsageBox.h UsageBox.cpp
UsageDiagram.h UsageDiagram.cpp
StoragePage.h StoragePage.cpp
StorageMeter.h StorageMeter.cpp
StorageBar.h StorageBar.cpp
StorageBarSkinlet.h StorageBarSkinlet.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
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)
qsk_add_example(iotdashboard ${SOURCES})

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
TestRectangle.h
ButtonBox.h
FlowLayoutPage.h
GridLayoutPage.h
LinearLayoutPage.h
DynamicConstraintsPage.h
StackLayoutPage.h)
set(SOURCES
TestRectangle.h TestRectangle.cpp
ButtonBox.h ButtonBox.cpp
FlowLayoutPage.h FlowLayoutPage.cpp
GridLayoutPage.h GridLayoutPage.cpp
LinearLayoutPage.h LinearLayoutPage.cpp
DynamicConstraintsPage.h DynamicConstraintsPage.cpp
StackLayoutPage.h StackLayoutPage.cpp
main.cpp
)
qt_add_resources(SOURCES layouts.qrc)
list(APPEND SOURCES
TestRectangle.cpp
ButtonBox.cpp
FlowLayoutPage.cpp
GridLayoutPage.cpp
LinearLayoutPage.cpp
DynamicConstraintsPage.cpp
StackLayoutPage.cpp
main.cpp)
qsk_add_example(layouts)
qsk_add_example(layouts ${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(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
MyToggleButton.cpp
MyToggleButtonSkinlet.cpp
main.cpp)
############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND HEADERS
MyToggleButton.h
MyToggleButtonSkinlet.h
MySkin.h)
qsk_add_example(mycontrols)
qsk_add_example(mycontrols
MySkin.h MySkin.cpp
MyToggleButton.h MyToggleButton.cpp
MyToggleButtonSkinlet.h MyToggleButtonSkinlet.cpp
main.cpp
)

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
MainWindow.cpp
main.cpp)
set(SOURCES MainWindow.h MainWindow.cpp main.cpp)
qt_add_resources(SOURCES qvgviewer.qrc)
list(APPEND RESOURCES
qvgviewer.qrc)
qsk_add_example(qvgviewer)
qsk_add_example(qvgviewer ${SOURCES})

View File

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

View File

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

View File

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

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
SkinFactory.h
Dial.h
DialSkinlet.h
Dashboard.h)
set(SOURCES
SkinFactory.h SkinFactory.cpp
Dial.h Dial.cpp
DialSkinlet.h DialSkinlet.cpp
Dashboard.h Dashboard.cpp
main.cpp
)
qt_add_resources(SOURCES images.qrc)
list(APPEND SOURCES
SkinFactory.cpp
Dial.cpp
DialSkinlet.cpp
Dashboard.cpp
main.cpp)
qsk_add_example(dials)
qsk_add_example(dials ${SOURCES})

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)
list(APPEND SOURCES GradientQuickShape.cpp)
list(APPEND HEADERS GradientQuickShape.cpp)
list(APPEND SOURCES GradientQuickShape.h GradientQuickShape.cpp)
endif()
qsk_add_example(gradients)
qsk_add_example(gradients ${SOURCES})
if(TARGET quickshapes_private)
target_compile_definitions(gradients PRIVATE SHAPE_GRADIENT)

View File

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

View File

@ -1,5 +1,9 @@
list(APPEND RESOURCES images.qrc)
list(APPEND HEADERS Image.h)
list(APPEND SOURCES Image.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(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)

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
GeometricShape.h
Window.h
Stroke.h)
############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# This file may be used under the terms of the 3-clause BSD License
############################################################################
list(APPEND SOURCES
Stroke.cpp
ShapeItem.cpp
GeometricShape.cpp
Window.cpp
main.cpp)
set(SOURCES
ShapeItem.h ShapeItem.cpp
GeometricShape.h GeometricShape.cpp
Stroke.h Stroke.cpp
Window.h Window.cpp
main.cpp
)
if( BUILD_QML_EXPORT )
list(APPEND RESOURCES shapes.qrc)
qt_add_resources(SOURCES shapes.qrc)
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)
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")
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
QskQmlGlobal.h
QskShortcutQml.h
QskLayoutQml.h
QskMainQml.h
QskQml.h)
set(HEADERS QskQmlGlobal.h QskShortcutQml.h QskLayoutQml.h QskMainQml.h QskQml.h)
set(SOURCES QskShortcutQml.cpp QskLayoutQml.cpp QskMainQml.cpp QskQml.cpp)
list(APPEND TARGET_SOURCES
QskShortcutQml.cpp
QskLayoutQml.cpp
QskMainQml.cpp
QskQml.cpp)
set(target qskqmlexport)
qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS})
target_link_libraries(${TARGET_NAME}
PRIVATE
qskinny)
target_include_directories(${TARGET_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(${target} PRIVATE qskinny)
target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_LIST_DIR})
if(BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME}
PRIVATE
QSK_QML_MAKEDLL)
target_compile_definitions(${target} PRIVATE QSK_QML_MAKEDLL)
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
QskMaterial3Global.h
QskMaterial3Skin.h
QskMaterial3SkinFactory.h)
set(SOURCES
QskMaterial3Global.h QskMaterial3Skin.h QskMaterial3Skin.cpp
QskMaterial3SkinFactory.h QskMaterial3SkinFactory.cpp
)
qt_add_resources(SOURCES icons.qrc)
list(APPEND SOURCES
QskMaterial3Skin.cpp
QskMaterial3SkinFactory.cpp)
list(APPEND RESOURCES icons.qrc )
qsk_add_plugin(material3skin skins QskMaterial3SkinFactory)
qsk_add_plugin(material3skin skins QskMaterial3SkinFactory ${SOURCES})
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
QskSquiekGlobal.h
QskSquiekSkin.h
QskSquiekSkinFactory.h)
list(APPEND SOURCES
QskSquiekSkin.cpp
QskSquiekSkinFactory.cpp)
qsk_add_plugin(squiekskin skins QskSquiekSkinFactory)
qsk_add_plugin(squiekskin skins QskSquiekSkinFactory
QskSquiekGlobal.h QskSquiekSkin.h QskSquiekSkin.cpp
QskSquiekSkinFactory.h QskSquiekSkinFactory.cpp
)
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)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
common/QskArcMetrics.h
common/QskAspect.h
common/QskBoxBorderColors.h
@ -30,9 +35,10 @@ list(APPEND TARGET_HEADERS
common/QskSizePolicy.h
common/QskStateCombination.h
common/QskTextColors.h
common/QskTextOptions.h)
common/QskTextOptions.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
common/QskArcMetrics.cpp
common/QskAspect.cpp
common/QskBoxBorderColors.cpp
@ -58,9 +64,10 @@ list(APPEND TARGET_SOURCES
common/QskShadowMetrics.cpp
common/QskSizePolicy.cpp
common/QskTextColors.cpp
common/QskTextOptions.cpp)
common/QskTextOptions.cpp
)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
graphic/QskColorFilter.h
graphic/QskGraphic.h
graphic/QskGraphicImageProvider.h
@ -71,9 +78,10 @@ list(APPEND TARGET_HEADERS
graphic/QskGraphicTextureFactory.h
graphic/QskIcon.h
graphic/QskPainterCommand.h
graphic/QskStandardSymbol.h)
graphic/QskStandardSymbol.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
graphic/QskColorFilter.cpp
graphic/QskGraphic.cpp
graphic/QskGraphicImageProvider.cpp
@ -84,9 +92,10 @@ list(APPEND TARGET_SOURCES
graphic/QskGraphicTextureFactory.cpp
graphic/QskIcon.cpp
graphic/QskPainterCommand.cpp
graphic/QskStandardSymbol.cpp)
graphic/QskStandardSymbol.cpp
)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
nodes/QskArcNode.h
nodes/QskArcRenderer.h
nodes/QskBoxNode.h
@ -113,9 +122,10 @@ list(APPEND TARGET_HEADERS
nodes/QskTextRenderer.h
nodes/QskTextureRenderer.h
nodes/QskTickmarksNode.h
nodes/QskVertex.h)
nodes/QskVertex.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
nodes/QskArcNode.cpp
nodes/QskArcRenderer.cpp
nodes/QskBoxNode.cpp
@ -142,12 +152,12 @@ list(APPEND TARGET_SOURCES
nodes/QskTextRenderer.cpp
nodes/QskTextureRenderer.cpp
nodes/QskTickmarksNode.cpp
nodes/QskVertex.cpp)
nodes/QskVertex.cpp
)
list(APPEND TARGET_RESSOURCES
nodes/shaders.qrc)
qt_add_resources(SOURCES nodes/shaders.qrc)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
controls/QskAbstractButton.h
controls/QskAnimationHint.h
controls/QskAnimator.h
@ -236,9 +246,10 @@ list(APPEND TARGET_HEADERS
controls/QskTextLabel.h
controls/QskTextLabelSkinlet.h
controls/QskVariantAnimator.h
controls/QskWindow.h)
controls/QskWindow.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
controls/QskAbstractButton.cpp
controls/QskAnimator.cpp
controls/QskAnimationHint.cpp
@ -326,9 +337,10 @@ list(APPEND TARGET_SOURCES
controls/QskTextLabel.cpp
controls/QskTextLabelSkinlet.cpp
controls/QskVariantAnimator.cpp
controls/QskWindow.cpp)
controls/QskWindow.cpp
)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
layouts/QskGridBox.h
layouts/QskGridLayoutEngine.h
layouts/QskIndexedLayoutBox.h
@ -340,9 +352,10 @@ list(APPEND TARGET_HEADERS
layouts/QskLinearLayoutEngine.h
layouts/QskStackBoxAnimator.h
layouts/QskStackBox.h
layouts/QskSubcontrolLayoutEngine.h)
layouts/QskSubcontrolLayoutEngine.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
layouts/QskGridBox.cpp
layouts/QskGridLayoutEngine.cpp
layouts/QskIndexedLayoutBox.cpp
@ -354,9 +367,10 @@ list(APPEND TARGET_SOURCES
layouts/QskLinearLayoutEngine.cpp
layouts/QskStackBoxAnimator.cpp
layouts/QskStackBox.cpp
layouts/QskSubcontrolLayoutEngine.cpp)
layouts/QskSubcontrolLayoutEngine.cpp
)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
dialogs/QskDialog.h
dialogs/QskDialogButton.h
dialogs/QskDialogButtonBox.h
@ -365,9 +379,10 @@ list(APPEND TARGET_HEADERS
dialogs/QskMessageSubWindow.h
dialogs/QskMessageWindow.h
dialogs/QskSelectionSubWindow.h
dialogs/QskSelectionWindow.h)
dialogs/QskSelectionWindow.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
dialogs/QskDialogButton.cpp
dialogs/QskDialogButtonBox.cpp
dialogs/QskDialog.cpp
@ -376,57 +391,50 @@ list(APPEND TARGET_SOURCES
dialogs/QskMessageSubWindow.cpp
dialogs/QskMessageWindow.cpp
dialogs/QskSelectionSubWindow.cpp
dialogs/QskSelectionWindow.cpp)
dialogs/QskSelectionWindow.cpp
)
list(APPEND TARGET_HEADERS
list(APPEND HEADERS
inputpanel/QskTextPredictor.h
inputpanel/QskInputContext.h
inputpanel/QskInputPanel.h
inputpanel/QskInputPanelBox.h
inputpanel/QskInputPredictionBar.h
inputpanel/QskVirtualKeyboard.h)
inputpanel/QskVirtualKeyboard.h
)
list(APPEND TARGET_SOURCES
list(APPEND SOURCES
inputpanel/QskTextPredictor.cpp
inputpanel/QskInputContext.cpp
inputpanel/QskInputPanel.cpp
inputpanel/QskInputPanelBox.cpp
inputpanel/QskInputPredictionBar.cpp
inputpanel/QskVirtualKeyboard.cpp)
inputpanel/QskVirtualKeyboard.cpp
)
if(ENABLE_PINYIN)
list(APPEND TARGET_HEADERS
inputpanel/QskPinyinTextPredictor.h)
list(APPEND TARGET_SOURCES
inputpanel/QskPinyinTextPredictor.cpp)
list(APPEND HEADERS inputpanel/QskPinyinTextPredictor.h)
list(APPEND SOURCES inputpanel/QskPinyinTextPredictor.cpp)
endif()
if(ENABLE_HUNSPELL)
list(APPEND TARGET_HEADERS
inputpanel/QskHunspellTextPredictor.h)
list(APPEND TARGET_SOURCES
inputpanel/QskHunspellTextPredictor.cpp)
list(APPEND HEADERS inputpanel/QskHunspellTextPredictor.h)
list(APPEND SOURCES inputpanel/QskHunspellTextPredictor.cpp)
endif()
set(TARGET_NAME qskinny)
set(target qskinny)
if(BUILD_QSKDLL)
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESSOURCES})
qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
else()
qsk_add_library(${TARGET_NAME} STATIC ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESSOURCES})
qsk_add_library(${target} STATIC ${SOURCES} ${HEADERS})
endif()
if(BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME}
PUBLIC
QSK_DLL
PRIVATE
QSK_MAKEDLL)
target_compile_definitions(${target} PUBLIC QSK_DLL PRIVATE QSK_MAKEDLL)
endif()
target_include_directories(${TARGET_NAME}
PUBLIC
target_include_directories(${target} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/dialogs>
@ -435,53 +443,34 @@ target_include_directories(${TARGET_NAME}
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/layouts>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/nodes>)
target_include_directories(${TARGET_NAME}
INTERFACE
$<INSTALL_INTERFACE:${QSK_INSTALL_HEADERS}>)
target_include_directories(${target}
INTERFACE $<INSTALL_INTERFACE:${QSK_INSTALL_HEADERS}>)
target_link_libraries(${TARGET_NAME}
PUBLIC
Qt::Core
Qt::CorePrivate
Qt::Quick
Qt::QuickPrivate)
target_link_libraries(${target}
PUBLIC Qt::Core Qt::CorePrivate Qt::Quick Qt::QuickPrivate)
if (QT_VERSION_MAJOR VERSION_GREATER "5")
target_link_libraries(${TARGET_NAME}
PUBLIC
Qt::OpenGL
Qt::OpenGLPrivate)
target_link_libraries(${target}
PUBLIC Qt::OpenGL Qt::OpenGLPrivate)
endif()
if(ENABLE_HUNSPELL)
target_link_libraries(${TARGET_NAME}
PRIVATE
hunspell)
target_link_libraries(${target} PRIVATE hunspell)
endif()
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}
PRIVATE
pinyin
Fcitx5::Utils)
target_include_directories(${TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/inputcontext>)
target_include_directories(${target}
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/inputcontext>)
endif()
set_target_properties(${TARGET_NAME}
PROPERTIES
FOLDER libs)
set_target_properties(${target} PROPERTIES FOLDER libs)
# TODO hack for standalone qvg2svg
set_target_properties(${TARGET_NAME}
PROPERTIES
AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
set_target_properties(${target}
PROPERTIES AUTOGEN_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/qskinny_autogen)
list(TRANSFORM TARGET_HEADERS PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
set_target_properties(${TARGET_NAME}
PROPERTIES
PUBLIC_HEADER "${TARGET_HEADERS}")
list(TRANSFORM HEADERS PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
set_target_properties(${target} PROPERTIES PUBLIC_HEADER "${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
SkinnyNamespace.h
SkinnyShapeFactory.h
SkinnyShapeProvider.h
SkinnyShortcut.h)
SkinnyNamespace.h SkinnyNamespace.cpp
SkinnyShapeFactory.h SkinnyShapeFactory.cpp
SkinnyShapeProvider.h SkinnyShapeProvider.cpp
SkinnyShortcut.h SkinnyShortcut.cpp
)
list(APPEND TARGET_SOURCES
SkinnyNamespace.cpp
SkinnyShapeFactory.cpp
SkinnyShapeProvider.cpp
SkinnyShortcut.cpp)
set(TARGET_NAME qsktestsupport)
set(target qsktestsupport)
if (BUILD_QSKDLL)
qsk_add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS})
qsk_add_library(${target} SHARED ${SOURCES})
else()
qsk_add_library(${TARGET_NAME} STATIC ${TARGET_SOURCES} ${TARGET_HEADERS})
qsk_add_library(${target} STATIC ${SOURCES})
endif()
set(HACK_FONT_CONFIG ON)
@ -38,32 +38,29 @@ if(HACK_FONT_CONFIG)
@ONLY
NEWLINE_STYLE LF)
target_compile_definitions(${TARGET_NAME}
PRIVATE
FONTCONFIG_FILE=${QSK_FONTCONF_FILE})
target_compile_definitions(${target}
PRIVATE FONTCONFIG_FILE=${QSK_FONTCONF_FILE})
endif()
target_link_libraries(${TARGET_NAME} PUBLIC qskinny)
target_link_libraries(${target} PUBLIC qskinny)
if (BUILD_QSKDLL)
target_compile_definitions(${TARGET_NAME} PRIVATE SKINNY_MAKEDLL)
target_compile_definitions(${target} PRIVATE SKINNY_MAKEDLL)
endif()
target_compile_definitions(${TARGET_NAME}
target_compile_definitions(${target}
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)
#set( ENABLE_ENSURE_SKINS OFF )
endif()
if(ENABLE_ENSURE_SKINS)
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
target_compile_definitions(${TARGET_NAME} PRIVATE ENSURE_SKINS)
target_link_libraries(${TARGET_NAME}
PRIVATE squiekskin material3skin)
target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
target_compile_definitions(${target} PRIVATE ENSURE_SKINS)
target_link_libraries(${target} PRIVATE squiekskin material3skin)
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)
# 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.
# 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
get_target_property(qskinny_AUTOGEN_DIR qskinny AUTOGEN_BUILD_DIR)
@ -20,34 +23,20 @@ if(BUILD_SVG2QVG_STANDALONE)
if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
add_definitions("/I${qskinny_AUTOGEN_DIR}/include_\$(Configuration)")
else()
target_include_directories(${TARGET_NAME}
PRIVATE
${qskinny_AUTOGEN_DIR}/include)
target_include_directories(${target} PRIVATE ${qskinny_AUTOGEN_DIR}/include)
endif()
target_include_directories(${TARGET_NAME}
target_include_directories(${target}
PRIVATE
${CMAKE_SOURCE_DIR}/src/common
${CMAKE_SOURCE_DIR}/src/graphic)
target_compile_definitions(${TARGET_NAME}
PRIVATE
QSK_STANDALONE)
target_link_libraries(${TARGET_NAME}
PRIVATE
Qt::Gui
Qt::GuiPrivate
Qt::Svg)
else()
target_link_libraries(${TARGET_NAME}
PRIVATE
qskinny
Qt::Svg)
target_compile_definitions(${target} PRIVATE QSK_STANDALONE)
target_link_libraries(${target} PRIVATE Qt::Gui Qt::GuiPrivate)
endif()
set_target_properties(${TARGET_NAME}
PROPERTIES
FOLDER tools)
target_link_libraries(${target} PRIVATE qskinny Qt::Svg)
install(TARGETS ${TARGET_NAME})
set_target_properties(${target} PROPERTIES FOLDER tools)
install(TARGETS ${target})