summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/tools/echoplugin/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt36
-rw-r--r--examples/widgets/tools/echoplugin/plugin/CMakeLists.txt29
-rw-r--r--examples/widgets/tools/plugandpaint/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/plugandpaint/app/CMakeLists.txt12
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt14
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt10
-rw-r--r--examples/widgets/tools/styleplugin/CMakeLists.txt14
-rw-r--r--examples/widgets/tools/styleplugin/plugin/CMakeLists.txt31
-rw-r--r--examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt29
11 files changed, 60 insertions, 136 deletions
diff --git a/examples/widgets/tools/echoplugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/CMakeLists.txt
index 380cfcae8e..6e32a4de09 100644
--- a/examples/widgets/tools/echoplugin/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/CMakeLists.txt
@@ -1,4 +1,15 @@
-# Generated from echoplugin.pro.
+cmake_minimum_required(VERSION 3.16)
+project(plugandpaint LANGUAGES CXX)
-qt_internal_add_example(echowindow)
-qt_internal_add_example(plugin)
+find_package(Qt6 COMPONENTS Core Gui Widgets)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin")
+
+add_subdirectory(plugin)
+add_subdirectory(echowindow)
diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
index 96e5e77bf4..83f0c88456 100644
--- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
@@ -1,41 +1,25 @@
-# Generated from echowindow.pro.
-
-cmake_minimum_required(VERSION 3.16)
-project(echoplugin LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(echopluginwindow # special case: renamed target
+qt_add_executable(echopluginwindow
echointerface.h
echowindow.cpp echowindow.h
main.cpp
)
-set_target_properties(echopluginwindow PROPERTIES # special case
+set_target_properties(echopluginwindow PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(echopluginwindow PUBLIC # special case
+target_link_libraries(echopluginwindow PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
)
-install(TARGETS echopluginwindow # special case: renamed target
+if(NOT QT6_IS_SHARED_LIBS_BUILD)
+ target_link_libraries(echopluginwindow PRIVATE
+ echoplugin
+ )
+endif()
+
+install(TARGETS echopluginwindow
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
index 7ce196c4e2..fb727aa1d7 100644
--- a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
@@ -1,31 +1,11 @@
-# Generated from plugin.pro.
-
-cmake_minimum_required(VERSION 3.16)
-project(echoplugin LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin/plugins")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_plugin(echoplugin)
+qt_add_plugin(echoplugin
+ CLASS_NAME EchoPlugin
+)
target_sources(echoplugin PRIVATE
echoplugin.cpp echoplugin.h
)
set_target_properties(echoplugin PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
+ LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/echowindow"
)
target_include_directories(echoplugin PUBLIC
../echowindow
@@ -39,6 +19,5 @@ target_link_libraries(echoplugin PUBLIC
install(TARGETS echoplugin
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/widgets/tools/plugandpaint/CMakeLists.txt b/examples/widgets/tools/plugandpaint/CMakeLists.txt
index 1d4d412adf..e681812dad 100644
--- a/examples/widgets/tools/plugandpaint/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from plugandpaint.pro.
-# special case skip regeneration
cmake_minimum_required(VERSION 3.16)
project(plugandpaint LANGUAGES CXX)
diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
index 14cdaeb822..e3709ee0d3 100644
--- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
@@ -1,6 +1,3 @@
-# Generated from app.pro.
-# special case skip regeneration
-
qt_add_executable(plugandpaint
interfaces.h
main.cpp
@@ -12,13 +9,18 @@ set_target_properties(plugandpaint PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(plugandpaint PUBLIC
+target_link_libraries(plugandpaint PRIVATE
Qt::Widgets
pnp_basictools
)
+if(NOT QT6_IS_SHARED_LIBS_BUILD)
+ target_link_libraries(plugandpaint PRIVATE
+ pnp_extrafilters
+ )
+endif()
+
install(TARGETS plugandpaint
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt
index 1e63da97ca..9a2d66d99e 100644
--- a/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt
@@ -1,4 +1,2 @@
-# Generated from plugins.pro.
-
add_subdirectory(basictools)
add_subdirectory(extrafilters)
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
index c66f83ce62..0056205319 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
@@ -1,19 +1,15 @@
-# Generated from basictools.pro.
-# special case skip regeneration
-
-qt_add_plugin(pnp_basictools STATIC)
+qt_add_plugin(pnp_basictools
+ STATIC
+ CLASS_NAME BasicToolsPlugin
+)
target_sources(pnp_basictools PRIVATE
basictoolsplugin.cpp basictoolsplugin.h
)
-set_target_properties(pnp_basictools PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
target_include_directories(pnp_basictools PUBLIC
../../app
)
-target_link_libraries(pnp_basictools PUBLIC
+target_link_libraries(pnp_basictools PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
index 9227dd0537..2332f84399 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
@@ -1,19 +1,17 @@
-# Generated from extrafilters.pro.
-# special case skip regeneration
-
-qt_add_plugin(pnp_extrafilters)
+qt_add_plugin(pnp_extrafilters
+ CLASS_NAME ExtraFiltersPlugin
+)
target_sources(pnp_extrafilters PRIVATE
extrafiltersplugin.cpp extrafiltersplugin.h
)
set_target_properties(pnp_extrafilters PROPERTIES
- MACOSX_BUNDLE TRUE
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/app"
)
target_include_directories(pnp_extrafilters PUBLIC
../../app
)
-target_link_libraries(pnp_extrafilters PUBLIC
+target_link_libraries(pnp_extrafilters PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
diff --git a/examples/widgets/tools/styleplugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/CMakeLists.txt
index 6d3549dcad..33412f5306 100644
--- a/examples/widgets/tools/styleplugin/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/CMakeLists.txt
@@ -1,19 +1,15 @@
-# Generated from styleplugin.pro.
-
-# special case begin
cmake_minimum_required(VERSION 3.16)
project(styleplugin LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
+find_package(Qt6 COMPONENTS Widgets)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
-find_package(Qt6 COMPONENTS Widgets)
-# special case end
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin")
add_subdirectory(stylewindow)
add_subdirectory(plugin)
diff --git a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
index c33188d228..30a06231c1 100644
--- a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
@@ -1,34 +1,14 @@
-# Generated from plugin.pro.
-
-cmake_minimum_required(VERSION 3.16)
-project(simplestyleplugin LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin/styles")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_plugin(simplestyleplugin)
+qt_add_plugin(simplestyleplugin
+ CLASS_NAME SimpleStylePlugin
+)
target_sources(simplestyleplugin PRIVATE
simplestyle.cpp simplestyle.h
simplestyleplugin.cpp simplestyleplugin.h
)
set_target_properties(simplestyleplugin PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
+ LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/stylewindow/styles"
)
-target_link_libraries(simplestyleplugin PUBLIC
+target_link_libraries(simplestyleplugin PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
@@ -36,6 +16,5 @@ target_link_libraries(simplestyleplugin PUBLIC
install(TARGETS simplestyleplugin
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
index 264913f967..168c41fb60 100644
--- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
@@ -1,24 +1,3 @@
-# Generated from stylewindow.pro.
-
-cmake_minimum_required(VERSION 3.16)
-project(styleplugin LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
qt_add_executable(styleplugin
main.cpp
stylewindow.cpp stylewindow.h
@@ -27,14 +6,18 @@ set_target_properties(styleplugin PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(styleplugin PUBLIC
+target_link_libraries(styleplugin PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
)
+if(NOT QT6_IS_SHARED_LIBS_BUILD)
+ target_link_libraries(styleplugin PRIVATE
+ simplestyleplugin
+ )
+endif()
install(TARGETS styleplugin
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)