summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/audiosource
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 18:26:21 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-17 20:08:53 +0000
commitb45ce023950d9dc28342d5834f89bf30b6c9fc9f (patch)
tree113c88fdf16d71b3319311693d29d7fdfeabdadc /examples/multimedia/audiosource
parentbb7bea80eda01fbb694071aedf3c1f981e70e348 (diff)
Improve examples CMakeLists.txt
- Remove "# generated from xyz.pro" comment from pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Change-Id: I9f60da23df1547d685439b0263fa5bf533b7c69e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 236eec9cbe35f018f0c0617d4a0d707dea85b0ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/multimedia/audiosource')
-rw-r--r--examples/multimedia/audiosource/CMakeLists.txt16
1 files changed, 5 insertions, 11 deletions
diff --git a/examples/multimedia/audiosource/CMakeLists.txt b/examples/multimedia/audiosource/CMakeLists.txt
index 692a24564..8584dc2fb 100644
--- a/examples/multimedia/audiosource/CMakeLists.txt
+++ b/examples/multimedia/audiosource/CMakeLists.txt
@@ -1,36 +1,30 @@
cmake_minimum_required(VERSION 3.16)
project(audiosource 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")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/audiosource")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Multimedia)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Widgets)
qt_add_executable(audiosource
audiosource.cpp audiosource.h
main.cpp
)
+
set_target_properties(audiosource PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-# special case begin
+
target_include_directories(audiosource PUBLIC
../shared
)
-# special case end
+
target_link_libraries(audiosource PUBLIC
Qt::Core
Qt::Gui