summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-16 16:40:33 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-20 09:12:47 +0200
commit27f74c25de086852f71b776dda05abd8b3d8385a (patch)
tree7d8b106af6cd8d78e88bfb4b5ae6334caa1c09b3 /examples
parent5632f8990a7559a3161852d65a91841d26291a92 (diff)
CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661 Change-Id: Ib6722991251673c6531667cb6b318b0531df5cda Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/btchat/CMakeLists.txt8
-rw-r--r--examples/bluetooth/btfiletransfer/CMakeLists.txt8
-rw-r--r--examples/bluetooth/btscanner/CMakeLists.txt8
-rw-r--r--examples/bluetooth/chat/CMakeLists.txt8
-rw-r--r--examples/bluetooth/heartrate-game/CMakeLists.txt8
-rw-r--r--examples/bluetooth/heartrate-server/CMakeLists.txt14
-rw-r--r--examples/bluetooth/lowenergyscanner/CMakeLists.txt8
-rw-r--r--examples/bluetooth/picturetransfer/CMakeLists.txt8
-rw-r--r--examples/bluetooth/pingpong/CMakeLists.txt8
-rw-r--r--examples/bluetooth/scanner/CMakeLists.txt8
-rw-r--r--examples/nfc/CMakeLists.txt4
-rw-r--r--examples/nfc/annotatedurl/CMakeLists.txt8
-rw-r--r--examples/nfc/ndefeditor/CMakeLists.txt8
13 files changed, 78 insertions, 28 deletions
diff --git a/examples/bluetooth/btchat/CMakeLists.txt b/examples/bluetooth/btchat/CMakeLists.txt
index 554920fd..3848824f 100644
--- a/examples/bluetooth/btchat/CMakeLists.txt
+++ b/examples/bluetooth/btchat/CMakeLists.txt
@@ -9,13 +9,17 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/btchat")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/btchat")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(btchat
+qt_add_executable(btchat
chat.cpp chat.h chat.ui
chatclient.cpp chatclient.h
chatserver.cpp chatserver.h
diff --git a/examples/bluetooth/btfiletransfer/CMakeLists.txt b/examples/bluetooth/btfiletransfer/CMakeLists.txt
index 973d89c7..3a11abce 100644
--- a/examples/bluetooth/btfiletransfer/CMakeLists.txt
+++ b/examples/bluetooth/btfiletransfer/CMakeLists.txt
@@ -9,13 +9,17 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/btfiletransfer")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/btfiletransfer")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(btfiletransfer
+qt_add_executable(btfiletransfer
main.cpp
pindisplay.cpp pindisplay.h pindisplay.ui
progress.cpp progress.h progress.ui
diff --git a/examples/bluetooth/btscanner/CMakeLists.txt b/examples/bluetooth/btscanner/CMakeLists.txt
index c9718cd6..97da1610 100644
--- a/examples/bluetooth/btscanner/CMakeLists.txt
+++ b/examples/bluetooth/btscanner/CMakeLists.txt
@@ -9,13 +9,17 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/btscanner")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/btscanner")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(btscanner
+qt_add_executable(btscanner
device.cpp device.h device.ui
main.cpp
service.cpp service.h service.ui
diff --git a/examples/bluetooth/chat/CMakeLists.txt b/examples/bluetooth/chat/CMakeLists.txt
index b344d237..15864c8d 100644
--- a/examples/bluetooth/chat/CMakeLists.txt
+++ b/examples/bluetooth/chat/CMakeLists.txt
@@ -9,13 +9,17 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/chat")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/chat")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
find_package(Qt6 COMPONENTS Quick)
-add_qt_gui_executable(qml_chat
+qt_add_executable(qml_chat
qmlchat.cpp
)
target_link_libraries(qml_chat PUBLIC
diff --git a/examples/bluetooth/heartrate-game/CMakeLists.txt b/examples/bluetooth/heartrate-game/CMakeLists.txt
index 8d82dfb1..d782bfef 100644
--- a/examples/bluetooth/heartrate-game/CMakeLists.txt
+++ b/examples/bluetooth/heartrate-game/CMakeLists.txt
@@ -9,7 +9,11 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/heartrate-game")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/heartrate-game")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
@@ -17,7 +21,7 @@ find_package(Qt6 COMPONENTS Qml)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Bluetooth)
-add_qt_gui_executable(heartrate-game
+qt_add_executable(heartrate-game
bluetoothbaseclass.cpp bluetoothbaseclass.h
connectionhandler.cpp connectionhandler.h
devicefinder.cpp devicefinder.h
diff --git a/examples/bluetooth/heartrate-server/CMakeLists.txt b/examples/bluetooth/heartrate-server/CMakeLists.txt
index 0fbdec79..53ccd90e 100644
--- a/examples/bluetooth/heartrate-server/CMakeLists.txt
+++ b/examples/bluetooth/heartrate-server/CMakeLists.txt
@@ -9,12 +9,16 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/heartrate-server")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/heartrate-server")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
-add_qt_gui_executable(heartrate-server
+qt_add_executable(heartrate-server
main.cpp
)
target_link_libraries(heartrate-server PUBLIC
@@ -22,6 +26,12 @@ target_link_libraries(heartrate-server PUBLIC
Qt::Core
)
+if(ANDROID)
+ target_link_libraries(heartrate-server PUBLIC
+ Qt::Gui
+ )
+endif()
+
install(TARGETS heartrate-server
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/bluetooth/lowenergyscanner/CMakeLists.txt b/examples/bluetooth/lowenergyscanner/CMakeLists.txt
index 6c1ddd7a..2bb13bf5 100644
--- a/examples/bluetooth/lowenergyscanner/CMakeLists.txt
+++ b/examples/bluetooth/lowenergyscanner/CMakeLists.txt
@@ -9,14 +9,18 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/lowenergyscanner")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/lowenergyscanner")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Bluetooth)
-add_qt_gui_executable(lowenergyscanner
+qt_add_executable(lowenergyscanner
characteristicinfo.cpp characteristicinfo.h
device.cpp device.h
deviceinfo.cpp deviceinfo.h
diff --git a/examples/bluetooth/picturetransfer/CMakeLists.txt b/examples/bluetooth/picturetransfer/CMakeLists.txt
index d7ec6620..3b9a20a4 100644
--- a/examples/bluetooth/picturetransfer/CMakeLists.txt
+++ b/examples/bluetooth/picturetransfer/CMakeLists.txt
@@ -9,14 +9,18 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/picturetransfer")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/picturetransfer")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Bluetooth)
-add_qt_gui_executable(qml_picturetransfer
+qt_add_executable(qml_picturetransfer
filetransfer.cpp filetransfer.h
main.cpp
)
diff --git a/examples/bluetooth/pingpong/CMakeLists.txt b/examples/bluetooth/pingpong/CMakeLists.txt
index 1c3ee43e..717a2829 100644
--- a/examples/bluetooth/pingpong/CMakeLists.txt
+++ b/examples/bluetooth/pingpong/CMakeLists.txt
@@ -9,14 +9,18 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/pingpong")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/pingpong")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Bluetooth)
-add_qt_gui_executable(pingpong
+qt_add_executable(pingpong
main.cpp
pingpong.cpp pingpong.h
)
diff --git a/examples/bluetooth/scanner/CMakeLists.txt b/examples/bluetooth/scanner/CMakeLists.txt
index 653574d3..aca105cb 100644
--- a/examples/bluetooth/scanner/CMakeLists.txt
+++ b/examples/bluetooth/scanner/CMakeLists.txt
@@ -9,13 +9,17 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/bluetooth/scanner")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/scanner")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Bluetooth)
find_package(Qt6 COMPONENTS Quick)
-add_qt_gui_executable(qml_scanner
+qt_add_executable(qml_scanner
qmlscanner.cpp
)
target_link_libraries(qml_scanner PUBLIC
diff --git a/examples/nfc/CMakeLists.txt b/examples/nfc/CMakeLists.txt
index f7534f8f..a4e34262 100644
--- a/examples/nfc/CMakeLists.txt
+++ b/examples/nfc/CMakeLists.txt
@@ -4,7 +4,3 @@ if(TARGET Qt::Widgets)
add_subdirectory(annotatedurl)
add_subdirectory(ndefeditor)
endif()
-if(TARGET Qt::Quick)
- add_subdirectory(poster)
- add_subdirectory(corkboard)
-endif()
diff --git a/examples/nfc/annotatedurl/CMakeLists.txt b/examples/nfc/annotatedurl/CMakeLists.txt
index a68d33d6..e34342db 100644
--- a/examples/nfc/annotatedurl/CMakeLists.txt
+++ b/examples/nfc/annotatedurl/CMakeLists.txt
@@ -9,14 +9,18 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/nfc/annotatedurl")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/nfc/annotatedurl")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Nfc)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(annotatedurl
+qt_add_executable(annotatedurl
annotatedurl.cpp annotatedurl.h
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
diff --git a/examples/nfc/ndefeditor/CMakeLists.txt b/examples/nfc/ndefeditor/CMakeLists.txt
index 196d0360..5b996755 100644
--- a/examples/nfc/ndefeditor/CMakeLists.txt
+++ b/examples/nfc/ndefeditor/CMakeLists.txt
@@ -9,14 +9,18 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples/nfc/ndefeditor")
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/nfc/ndefeditor")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Nfc)
find_package(Qt6 COMPONENTS Widgets)
-add_qt_gui_executable(ndefeditor
+qt_add_executable(ndefeditor
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
mimeimagerecordeditor.cpp mimeimagerecordeditor.h mimeimagerecordeditor.ui