summaryrefslogtreecommitdiffstats
path: root/examples/qtconcurrent
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2019-06-04 17:08:47 +0200
committerKevin Funk <kevin.funk@kdab.com>2019-06-05 12:53:28 +0000
commit99539a289491a2a709c2a63cd91eac155a1699da (patch)
treed928d6c6e123c6588261bea9358354fe1e1a7400 /examples/qtconcurrent
parentace549587073d387823815b02ec85a28da408844 (diff)
Allow to build examples as standalone project
Create CMake config files which can be used from the very same CMake project. These CMake config files simply do not create any targets, controlled via the QT_NO_CREATE_TARGETS. This patch also allows to build qtbase.git:examples as a standalone project, against an already-built Qt. Ran this: ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example Task-number: QTBUG-74713 Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/qtconcurrent')
-rw-r--r--examples/qtconcurrent/imagescaling/CMakeLists.txt38
-rw-r--r--examples/qtconcurrent/map/.prev_CMakeLists.txt26
-rw-r--r--examples/qtconcurrent/map/CMakeLists.txt39
-rw-r--r--examples/qtconcurrent/progressdialog/CMakeLists.txt36
-rw-r--r--examples/qtconcurrent/runfunction/CMakeLists.txt37
-rw-r--r--examples/qtconcurrent/wordcount/CMakeLists.txt37
6 files changed, 143 insertions, 70 deletions
diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt
index 0de3f26c5e..a288397de7 100644
--- a/examples/qtconcurrent/imagescaling/CMakeLists.txt
+++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt
@@ -1,17 +1,29 @@
# Generated from imagescaling.pro.
-#####################################################################
-## imagescaling Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(imagescaling LANGUAGES CXX)
-add_qt_executable(imagescaling
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling"
- SOURCES
- imagescaling.cpp imagescaling.h
- main.cpp
- LIBRARIES
- Qt::Concurrent
- Qt::Widgets
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+find_package(Qt5 COMPONENTS Widgets)
+
+add_executable(imagescaling WIN32 MACOSX_BUNDLE
+ imagescaling.cpp imagescaling.h
+ main.cpp
+)
+target_link_libraries(imagescaling PUBLIC
+ Qt::Concurrent
+ Qt::Widgets
+)
+
+install(TARGETS imagescaling
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/qtconcurrent/map/.prev_CMakeLists.txt b/examples/qtconcurrent/map/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..48a18038ad
--- /dev/null
+++ b/examples/qtconcurrent/map/.prev_CMakeLists.txt
@@ -0,0 +1,26 @@
+# Generated from map.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(mapdemo LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+
+add_executable(mapdemo
+ main.cpp
+)
+target_link_libraries(mapdemo PUBLIC
+ Qt::Concurrent
+)
+
+install(TARGETS mapdemo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/map/CMakeLists.txt b/examples/qtconcurrent/map/CMakeLists.txt
index 147b91236b..a5bac9a973 100644
--- a/examples/qtconcurrent/map/CMakeLists.txt
+++ b/examples/qtconcurrent/map/CMakeLists.txt
@@ -1,20 +1,27 @@
# Generated from map.pro.
-#####################################################################
-## mapdemo Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(mapdemo LANGUAGES CXX)
-add_qt_executable(mapdemo
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map"
- SOURCES
- main.cpp
- LIBRARIES
- Qt::Concurrent
- Qt::Gui # special case
-)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+find_package(Qt5 COMPONENTS Gui) # special case
-#### Keys ignored in scope 1:.:map.pro:<NONE>:
-# CONFIG = "-app_bundle"
-# TEMPLATE = "app"
+add_executable(mapdemo
+ main.cpp
+)
+target_link_libraries(mapdemo PUBLIC
+ Qt::Concurrent
+ Qt::Gui # special case
+)
+install(TARGETS mapdemo
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/progressdialog/CMakeLists.txt b/examples/qtconcurrent/progressdialog/CMakeLists.txt
index 3aae4af084..8a61fd0e0a 100644
--- a/examples/qtconcurrent/progressdialog/CMakeLists.txt
+++ b/examples/qtconcurrent/progressdialog/CMakeLists.txt
@@ -1,18 +1,28 @@
# Generated from progressdialog.pro.
-#####################################################################
-## progressdialog Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(progressdialog LANGUAGES CXX)
-add_qt_executable(progressdialog
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog"
- SOURCES
- main.cpp
- LIBRARIES
- Qt::Concurrent
- Qt::Widgets
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+find_package(Qt5 COMPONENTS Widgets)
+
+add_executable(progressdialog
+ main.cpp
+)
+target_link_libraries(progressdialog PUBLIC
+ Qt::Concurrent
+ Qt::Widgets
)
-#### Keys ignored in scope 1:.:progressdialog.pro:<NONE>:
-# CONFIG = "console"
+install(TARGETS progressdialog
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt
index c400b44cf6..f71a789423 100644
--- a/examples/qtconcurrent/runfunction/CMakeLists.txt
+++ b/examples/qtconcurrent/runfunction/CMakeLists.txt
@@ -1,19 +1,28 @@
# Generated from runfunction.pro.
-#####################################################################
-## runfunction Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(runfunction LANGUAGES CXX)
-add_qt_executable(runfunction
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction"
- SOURCES
- main.cpp
- LIBRARIES
- Qt::Concurrent
- Qt::Widgets
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+find_package(Qt5 COMPONENTS Widgets)
+
+add_executable(runfunction
+ main.cpp
+)
+target_link_libraries(runfunction PUBLIC
+ Qt::Concurrent
+ Qt::Widgets
)
-#### Keys ignored in scope 1:.:runfunction.pro:<NONE>:
-# CONFIG = "-app_bundle"
+install(TARGETS runfunction
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qtconcurrent/wordcount/CMakeLists.txt b/examples/qtconcurrent/wordcount/CMakeLists.txt
index 9bb2ac58d7..4c6402102d 100644
--- a/examples/qtconcurrent/wordcount/CMakeLists.txt
+++ b/examples/qtconcurrent/wordcount/CMakeLists.txt
@@ -1,19 +1,28 @@
# Generated from wordcount.pro.
-#####################################################################
-## wordcount Binary:
-#####################################################################
+cmake_minimum_required(VERSION 3.14)
+project(wordcount LANGUAGES CXX)
-add_qt_executable(wordcount
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount"
- SOURCES
- main.cpp
- LIBRARIES
- Qt::Concurrent
- Qt::Widgets
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt5 COMPONENTS Concurrent)
+find_package(Qt5 COMPONENTS Widgets)
+
+add_executable(wordcount
+ main.cpp
+)
+target_link_libraries(wordcount PUBLIC
+ Qt::Concurrent
+ Qt::Widgets
)
-#### Keys ignored in scope 1:.:wordcount.pro:<NONE>:
-# CONFIG = "-app_bundle"
+install(TARGETS wordcount
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+)