summaryrefslogtreecommitdiffstats
path: root/examples/corelib
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-02-10 18:31:58 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-02-11 10:19:42 +0100
commitf1ae5ae726cf909e4ee943eae8e09f8aff74bb3e (patch)
tree0035f377344b27ec20aa3e2d9b64eab4d971a42a /examples/corelib
parent79da236e76752c1f940036dffffebb8d2a707d66 (diff)
parent3af9d49bb78ac56bff57d1c3867853730f97a8e1 (diff)
Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"
Diffstat (limited to 'examples/corelib')
-rw-r--r--examples/corelib/ipc/localfortuneclient/CMakeLists.txt7
-rw-r--r--examples/corelib/ipc/localfortuneserver/CMakeLists.txt7
-rw-r--r--examples/corelib/ipc/sharedmemory/CMakeLists.txt7
-rw-r--r--examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt9
-rw-r--r--examples/corelib/serialization/cbordump/CMakeLists.txt4
-rw-r--r--examples/corelib/serialization/convert/CMakeLists.txt4
-rw-r--r--examples/corelib/serialization/savegame/CMakeLists.txt4
-rw-r--r--examples/corelib/threads/mandelbrot/CMakeLists.txt13
-rw-r--r--examples/corelib/threads/queuedcustomtype/CMakeLists.txt7
-rw-r--r--examples/corelib/threads/semaphores/CMakeLists.txt3
-rw-r--r--examples/corelib/threads/waitconditions/CMakeLists.txt3
-rw-r--r--examples/corelib/tools/contiguouscache/CMakeLists.txt7
-rw-r--r--examples/corelib/tools/customtype/CMakeLists.txt7
-rw-r--r--examples/corelib/tools/customtypesending/CMakeLists.txt7
14 files changed, 71 insertions, 18 deletions
diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt
index b664e5795c..4c011e751b 100644
--- a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt
+++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/localfortuneclient")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,9 +21,12 @@ add_qt_gui_executable(localfortuneclient
main.cpp
)
target_link_libraries(localfortuneclient PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
+
install(TARGETS localfortuneclient
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt
index 4d75ad437f..014df19185 100644
--- a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt
+++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/localfortuneserver")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Network)
find_package(Qt6 COMPONENTS Widgets)
@@ -19,9 +21,12 @@ add_qt_gui_executable(localfortuneserver
server.cpp server.h
)
target_link_libraries(localfortuneserver PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Network
Qt::Widgets
)
+
install(TARGETS localfortuneserver
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt
index 514a49914f..6db5ea1a3b 100644
--- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt
+++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/ipc/sharedmemory")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(sharedmemory
@@ -18,8 +20,11 @@ add_qt_gui_executable(sharedmemory
main.cpp
)
target_link_libraries(sharedmemory PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS sharedmemory
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt
index e3ae3b7bb2..b62df6dd1e 100644
--- a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt
+++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt
@@ -9,18 +9,23 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/mimetypes/mimetypebrowser")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(mimetypebrowser
+add_executable(mimetypebrowser
main.cpp
mainwindow.cpp mainwindow.h
mimetypemodel.cpp mimetypemodel.h
)
target_link_libraries(mimetypebrowser PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS mimetypebrowser
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/serialization/cbordump/CMakeLists.txt b/examples/corelib/serialization/cbordump/CMakeLists.txt
index cedf7712d4..98b5044b4a 100644
--- a/examples/corelib/serialization/cbordump/CMakeLists.txt
+++ b/examples/corelib/serialization/cbordump/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/cbordump")
find_package(Qt6 COMPONENTS Core)
@@ -17,9 +17,9 @@ add_executable(cbordump
main.cpp
)
target_link_libraries(cbordump PUBLIC
- # Remove: gui
Qt::Core
)
+
install(TARGETS cbordump
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/serialization/convert/CMakeLists.txt b/examples/corelib/serialization/convert/CMakeLists.txt
index 04b57bbd3d..98d4a943d6 100644
--- a/examples/corelib/serialization/convert/CMakeLists.txt
+++ b/examples/corelib/serialization/convert/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/convert")
find_package(Qt6 COMPONENTS Core)
@@ -24,9 +24,9 @@ add_executable(convert
xmlconverter.cpp xmlconverter.h
)
target_link_libraries(convert PUBLIC
- # Remove: gui
Qt::Core
)
+
install(TARGETS convert
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/serialization/savegame/CMakeLists.txt b/examples/corelib/serialization/savegame/CMakeLists.txt
index 97d866da43..10851d55fd 100644
--- a/examples/corelib/serialization/savegame/CMakeLists.txt
+++ b/examples/corelib/serialization/savegame/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/serialization/savegame")
find_package(Qt6 COMPONENTS Core)
@@ -20,9 +20,9 @@ add_executable(savegame
main.cpp
)
target_link_libraries(savegame PUBLIC
- # Remove: gui
Qt::Core
)
+
install(TARGETS savegame
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt
index 6905429559..515eb3ed93 100644
--- a/examples/corelib/threads/mandelbrot/CMakeLists.txt
+++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/mandelbrot")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(mandelbrot
@@ -19,8 +21,17 @@ add_qt_gui_executable(mandelbrot
renderthread.cpp renderthread.h
)
target_link_libraries(mandelbrot PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
+if(UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS)
+ target_link_libraries(mandelbrot PUBLIC
+ m
+ )
+endif()
+
install(TARGETS mandelbrot
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt
index 78a59ac2dc..cc4ff1bd4a 100644
--- a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt
+++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/queuedcustomtype")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(queuedcustomtype
@@ -20,8 +22,11 @@ add_qt_gui_executable(queuedcustomtype
window.cpp window.h
)
target_link_libraries(queuedcustomtype PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS queuedcustomtype
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt
index ed36acde55..15b5dc56b9 100644
--- a/examples/corelib/threads/semaphores/CMakeLists.txt
+++ b/examples/corelib/threads/semaphores/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/semaphores")
find_package(Qt6 COMPONENTS Core)
@@ -19,6 +19,7 @@ add_executable(semaphores
target_link_libraries(semaphores PUBLIC
Qt::Core
)
+
install(TARGETS semaphores
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt
index 235cb91cdb..0b6d889d77 100644
--- a/examples/corelib/threads/waitconditions/CMakeLists.txt
+++ b/examples/corelib/threads/waitconditions/CMakeLists.txt
@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/threads/waitconditions")
find_package(Qt6 COMPONENTS Core)
@@ -19,6 +19,7 @@ add_executable(waitconditions
target_link_libraries(waitconditions PUBLIC
Qt::Core
)
+
install(TARGETS waitconditions
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt
index 3adb033c49..1e7a3350c2 100644
--- a/examples/corelib/tools/contiguouscache/CMakeLists.txt
+++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/contiguouscache")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(contiguouscache
@@ -18,8 +20,11 @@ add_qt_gui_executable(contiguouscache
randomlistmodel.cpp randomlistmodel.h
)
target_link_libraries(contiguouscache PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS contiguouscache
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt
index 11958e1c1b..74969ed2ea 100644
--- a/examples/corelib/tools/customtype/CMakeLists.txt
+++ b/examples/corelib/tools/customtype/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/customtype")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(customtype
@@ -18,8 +20,11 @@ add_qt_gui_executable(customtype
message.cpp message.h
)
target_link_libraries(customtype PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS customtype
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt
index f22894d919..1456eaf5dc 100644
--- a/examples/corelib/tools/customtypesending/CMakeLists.txt
+++ b/examples/corelib/tools/customtypesending/CMakeLists.txt
@@ -9,8 +9,10 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/corelib/tools/customtypesending")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(customtypesending
@@ -19,8 +21,11 @@ add_qt_gui_executable(customtypesending
window.cpp window.h
)
target_link_libraries(customtypesending PUBLIC
+ Qt::Core
+ Qt::Gui
Qt::Widgets
)
+
install(TARGETS customtypesending
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"