From bf496f8d06426633990389502c0d6dca8302154a Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 1 Apr 2023 17:34:43 +0200 Subject: [PATCH] sources as cmake function parameters --- cmake/QSkinnyMacros.cmake | 55 ++++---- examples/boxes/CMakeLists.txt | 8 +- examples/buttons/CMakeLists.txt | 11 +- examples/desktop/CMakeLists.txt | 7 +- examples/frames/CMakeLists.txt | 12 +- examples/gallery/CMakeLists.txt | 35 +++-- examples/glabels/CMakeLists.txt | 11 +- examples/iotdashboard/CMakeLists.txt | 118 ++++++---------- examples/layouts/CMakeLists.txt | 36 +++-- examples/listbox/CMakeLists.txt | 7 +- examples/messagebox/CMakeLists.txt | 7 +- examples/messageboxQml/CMakeLists.txt | 11 +- examples/mycontrols/CMakeLists.txt | 21 ++- examples/qvgviewer/CMakeLists.txt | 16 +-- examples/tabview/CMakeLists.txt | 21 ++- examples/thumbnails/CMakeLists.txt | 7 +- inputcontext/CMakeLists.txt | 25 ++-- playground/anchors/CMakeLists.txt | 32 ++--- playground/dialogbuttons/CMakeLists.txt | 8 +- playground/dials/CMakeLists.txt | 27 ++-- playground/gradients/CMakeLists.txt | 15 ++- playground/grids/CMakeLists.txt | 30 ++--- playground/images/CMakeLists.txt | 12 +- playground/inputpanel/CMakeLists.txt | 7 +- playground/invoker/CMakeLists.txt | 8 +- playground/shadows/CMakeLists.txt | 8 +- playground/shapes/CMakeLists.txt | 28 ++-- playground/webview/CMakeLists.txt | 7 +- qmlexport/CMakeLists.txt | 37 ++--- skins/material3/CMakeLists.txt | 22 ++- skins/squiek/CMakeLists.txt | 19 ++- src/CMakeLists.txt | 171 +++++++++++------------- support/CMakeLists.txt | 51 ++++--- tools/svg2qvg/CMakeLists.txt | 41 +++--- 34 files changed, 448 insertions(+), 483 deletions(-) diff --git a/cmake/QSkinnyMacros.cmake b/cmake/QSkinnyMacros.cmake index 4def69fe..16fff28c 100644 --- a/cmake/QSkinnyMacros.cmake +++ b/cmake/QSkinnyMacros.cmake @@ -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() diff --git a/examples/boxes/CMakeLists.txt b/examples/boxes/CMakeLists.txt index 80dd3bf6..f77c5bcf 100644 --- a/examples/boxes/CMakeLists.txt +++ b/examples/boxes/CMakeLists.txt @@ -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) diff --git a/examples/buttons/CMakeLists.txt b/examples/buttons/CMakeLists.txt index 3c5708ef..88c9d477 100644 --- a/examples/buttons/CMakeLists.txt +++ b/examples/buttons/CMakeLists.txt @@ -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}) diff --git a/examples/desktop/CMakeLists.txt b/examples/desktop/CMakeLists.txt index 58ba4aea..54b495c5 100644 --- a/examples/desktop/CMakeLists.txt +++ b/examples/desktop/CMakeLists.txt @@ -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) diff --git a/examples/frames/CMakeLists.txt b/examples/frames/CMakeLists.txt index 5a5e3e33..bdfaaee8 100644 --- a/examples/frames/CMakeLists.txt +++ b/examples/frames/CMakeLists.txt @@ -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}) diff --git a/examples/gallery/CMakeLists.txt b/examples/gallery/CMakeLists.txt index 11b6fc72..dd837b0f 100644 --- a/examples/gallery/CMakeLists.txt +++ b/examples/gallery/CMakeLists.txt @@ -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) diff --git a/examples/glabels/CMakeLists.txt b/examples/glabels/CMakeLists.txt index 21b9c53f..f4462ee8 100644 --- a/examples/glabels/CMakeLists.txt +++ b/examples/glabels/CMakeLists.txt @@ -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}) diff --git a/examples/iotdashboard/CMakeLists.txt b/examples/iotdashboard/CMakeLists.txt index 9afbf48c..81f4ef27 100644 --- a/examples/iotdashboard/CMakeLists.txt +++ b/examples/iotdashboard/CMakeLists.txt @@ -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}) diff --git a/examples/layouts/CMakeLists.txt b/examples/layouts/CMakeLists.txt index 5b83f063..bfbbe041 100644 --- a/examples/layouts/CMakeLists.txt +++ b/examples/layouts/CMakeLists.txt @@ -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}) diff --git a/examples/listbox/CMakeLists.txt b/examples/listbox/CMakeLists.txt index 726eeee2..e6a002e6 100644 --- a/examples/listbox/CMakeLists.txt +++ b/examples/listbox/CMakeLists.txt @@ -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) diff --git a/examples/messagebox/CMakeLists.txt b/examples/messagebox/CMakeLists.txt index a251f796..3ff79c51 100644 --- a/examples/messagebox/CMakeLists.txt +++ b/examples/messagebox/CMakeLists.txt @@ -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) diff --git a/examples/messageboxQml/CMakeLists.txt b/examples/messageboxQml/CMakeLists.txt index c14712d9..ce4c7c30 100644 --- a/examples/messageboxQml/CMakeLists.txt +++ b/examples/messageboxQml/CMakeLists.txt @@ -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}) diff --git a/examples/mycontrols/CMakeLists.txt b/examples/mycontrols/CMakeLists.txt index 49ad8a07..b0b94e37 100644 --- a/examples/mycontrols/CMakeLists.txt +++ b/examples/mycontrols/CMakeLists.txt @@ -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 +) diff --git a/examples/qvgviewer/CMakeLists.txt b/examples/qvgviewer/CMakeLists.txt index feef8796..95d92215 100644 --- a/examples/qvgviewer/CMakeLists.txt +++ b/examples/qvgviewer/CMakeLists.txt @@ -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}) diff --git a/examples/tabview/CMakeLists.txt b/examples/tabview/CMakeLists.txt index 965dd8d8..d8b79eee 100644 --- a/examples/tabview/CMakeLists.txt +++ b/examples/tabview/CMakeLists.txt @@ -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 +) diff --git a/examples/thumbnails/CMakeLists.txt b/examples/thumbnails/CMakeLists.txt index 62fa42cd..33145919 100644 --- a/examples/thumbnails/CMakeLists.txt +++ b/examples/thumbnails/CMakeLists.txt @@ -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) diff --git a/inputcontext/CMakeLists.txt b/inputcontext/CMakeLists.txt index 6cd90725..6dba05bd 100644 --- a/inputcontext/CMakeLists.txt +++ b/inputcontext/CMakeLists.txt @@ -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) diff --git a/playground/anchors/CMakeLists.txt b/playground/anchors/CMakeLists.txt index 079cd9a6..734f0e38 100644 --- a/playground/anchors/CMakeLists.txt +++ b/playground/anchors/CMakeLists.txt @@ -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}) diff --git a/playground/dialogbuttons/CMakeLists.txt b/playground/dialogbuttons/CMakeLists.txt index 01023ac0..0414e3a7 100644 --- a/playground/dialogbuttons/CMakeLists.txt +++ b/playground/dialogbuttons/CMakeLists.txt @@ -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) diff --git a/playground/dials/CMakeLists.txt b/playground/dials/CMakeLists.txt index 7d409637..8181e76e 100644 --- a/playground/dials/CMakeLists.txt +++ b/playground/dials/CMakeLists.txt @@ -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}) diff --git a/playground/gradients/CMakeLists.txt b/playground/gradients/CMakeLists.txt index 6da16c46..2585b70e 100644 --- a/playground/gradients/CMakeLists.txt +++ b/playground/gradients/CMakeLists.txt @@ -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) diff --git a/playground/grids/CMakeLists.txt b/playground/grids/CMakeLists.txt index 4e0f1e96..1c9473f3 100644 --- a/playground/grids/CMakeLists.txt +++ b/playground/grids/CMakeLists.txt @@ -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) diff --git a/playground/images/CMakeLists.txt b/playground/images/CMakeLists.txt index 054c7e34..d331f3d7 100644 --- a/playground/images/CMakeLists.txt +++ b/playground/images/CMakeLists.txt @@ -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}) diff --git a/playground/inputpanel/CMakeLists.txt b/playground/inputpanel/CMakeLists.txt index 03bbd5ee..c7e5d143 100644 --- a/playground/inputpanel/CMakeLists.txt +++ b/playground/inputpanel/CMakeLists.txt @@ -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) diff --git a/playground/invoker/CMakeLists.txt b/playground/invoker/CMakeLists.txt index efd92139..e1377546 100644 --- a/playground/invoker/CMakeLists.txt +++ b/playground/invoker/CMakeLists.txt @@ -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) diff --git a/playground/shadows/CMakeLists.txt b/playground/shadows/CMakeLists.txt index 534a3eda..3f375cbe 100644 --- a/playground/shadows/CMakeLists.txt +++ b/playground/shadows/CMakeLists.txt @@ -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) diff --git a/playground/shapes/CMakeLists.txt b/playground/shapes/CMakeLists.txt index b1fff6f6..95b42221 100644 --- a/playground/shapes/CMakeLists.txt +++ b/playground/shapes/CMakeLists.txt @@ -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() diff --git a/playground/webview/CMakeLists.txt b/playground/webview/CMakeLists.txt index 2056dbb0..77902059 100644 --- a/playground/webview/CMakeLists.txt +++ b/playground/webview/CMakeLists.txt @@ -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) diff --git a/qmlexport/CMakeLists.txt b/qmlexport/CMakeLists.txt index d0c20d64..60bcee65 100644 --- a/qmlexport/CMakeLists.txt +++ b/qmlexport/CMakeLists.txt @@ -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) diff --git a/skins/material3/CMakeLists.txt b/skins/material3/CMakeLists.txt index 9f6fb53a..238a988e 100644 --- a/skins/material3/CMakeLists.txt +++ b/skins/material3/CMakeLists.txt @@ -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) diff --git a/skins/squiek/CMakeLists.txt b/skins/squiek/CMakeLists.txt index db7aaaa6..f2c6e72e 100644 --- a/skins/squiek/CMakeLists.txt +++ b/skins/squiek/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ebba951..777f5da3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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,112 +391,86 @@ 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 + $ + $ + $ + $ + $ + $ + $) -target_include_directories(${TARGET_NAME} - INTERFACE - $) +target_include_directories(${target} + INTERFACE $) -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 - $) + target_include_directories(${target} + PUBLIC $) 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}") diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 70ba17ff..81fb52ab 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -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}) diff --git a/tools/svg2qvg/CMakeLists.txt b/tools/svg2qvg/CMakeLists.txt index 6a1b3350..ad8c7abd 100644 --- a/tools/svg2qvg/CMakeLists.txt +++ b/tools/svg2qvg/CMakeLists.txt @@ -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 -> #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})