diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-01-24 16:56:28 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-08 14:16:11 +0100 |
commit | bc152dd9e2569a64e8aa152eb7879b9f09e4a77e (patch) | |
tree | bab27538fad74ed0061a91a434ff5fe03b03ab83 /examples | |
parent | bab7f8d37d35f69152ab12f7d99649b4a8ce9cb2 (diff) | |
download | qtactiveqt-bc152dd9e2569a64e8aa152eb7879b9f09e4a77e.tar.gz |
Improve examples CMakeLists.txt
- Remove '# generated from ' comments
- Only opt into CMAKE_AUTOUIC if .ui files are involved
- Only opt into CMAKE_AUTORCC if .qrc files are involved
- Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR
- use REQUIRED COMPONENTS in find_package calls; sort components alphabetically
- Fix wrong indentations
- Use (only) one empty line after multi-line commands
Pick-to: 6.3
Change-Id: Ie1fec5e5429ef9022b4c892c5950d518cbd1b0b3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/activeqt/CMakeLists.txt | 4 | ||||
-rw-r--r-- | examples/activeqt/comapp/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/hierarchy/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/mediaplayer/CMakeLists.txt | 10 | ||||
-rw-r--r-- | examples/activeqt/menus/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/multiple/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/opengl/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/qutlook/CMakeLists.txt | 13 | ||||
-rw-r--r-- | examples/activeqt/simple/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/simpleqml/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/activeqt/wrapper/CMakeLists.txt | 11 |
12 files changed, 31 insertions, 86 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3baa897..14d4dff 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from examples.pro. - qt_examples_build_begin(EXTERNAL_BUILD) add_subdirectory(activeqt) diff --git a/examples/activeqt/CMakeLists.txt b/examples/activeqt/CMakeLists.txt index 168dd37..c4cbe76 100644 --- a/examples/activeqt/CMakeLists.txt +++ b/examples/activeqt/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from activeqt.pro. - if(MSVC) qt_internal_add_example(comapp) qt_internal_add_example(hierarchy) @@ -7,7 +5,7 @@ if(MSVC) qt_internal_add_example(multiple) qt_internal_add_example(simple) qt_internal_add_example(wrapper) - if(TARGET Qt6::OpenGLWidgets AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2) # special case + if(TARGET Qt6::OpenGLWidgets AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2) qt_internal_add_example(opengl) endif() if(TARGET Qt::QuickControls2) diff --git a/examples/activeqt/comapp/CMakeLists.txt b/examples/activeqt/comapp/CMakeLists.txt index 0434c4c..8fc84d6 100644 --- a/examples/activeqt/comapp/CMakeLists.txt +++ b/examples/activeqt/comapp/CMakeLists.txt @@ -1,25 +1,20 @@ -# Generated from comapp.pro. - cmake_minimum_required(VERSION 3.16) project(comapp 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}/activeqt/comapp") -find_package(Qt6 COMPONENTS Core Gui AxServer Widgets) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_executable(comapp main.cpp comapp.rc ) + target_link_libraries(comapp PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/hierarchy/CMakeLists.txt b/examples/activeqt/hierarchy/CMakeLists.txt index 35067ab..9192a8f 100644 --- a/examples/activeqt/hierarchy/CMakeLists.txt +++ b/examples/activeqt/hierarchy/CMakeLists.txt @@ -1,21 +1,15 @@ -# Generated from hierarchy.pro. - cmake_minimum_required(VERSION 3.16) project(hierarchyax 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}/activeqt/hierarchy") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_library(hierarchyax main.cpp @@ -23,6 +17,7 @@ qt6_add_axserver_library(hierarchyax hierarchy.def hierarchy.rc ) + target_link_libraries(hierarchyax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/mediaplayer/CMakeLists.txt b/examples/activeqt/mediaplayer/CMakeLists.txt index 3f9f3aa..1c9d02e 100644 --- a/examples/activeqt/mediaplayer/CMakeLists.txt +++ b/examples/activeqt/mediaplayer/CMakeLists.txt @@ -4,29 +4,27 @@ project(mediaplayer_activeqt 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}/activeqt/mediaplayer_activeqt") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS AxContainer) +find_package(Qt6 REQUIRED COMPONENTS AxContainer Core Gui Widgets) qt_add_executable(mediaplayer_activeqt main.cpp mainwindow.ui mediaaxwidget.h ) + set_target_properties(mediaplayer_activeqt PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(mediaplayer_activeqt PUBLIC Qt::AxContainer Qt::Core diff --git a/examples/activeqt/menus/CMakeLists.txt b/examples/activeqt/menus/CMakeLists.txt index 135f2ad..35dac7e 100644 --- a/examples/activeqt/menus/CMakeLists.txt +++ b/examples/activeqt/menus/CMakeLists.txt @@ -1,21 +1,15 @@ -# Generated from menus.pro. - cmake_minimum_required(VERSION 3.16) project(menusax 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}/activeqt/menus") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_executable(menusax main.cpp @@ -23,6 +17,7 @@ qt6_add_axserver_executable(menusax menus.def menus.rc ) + target_link_libraries(menusax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/multiple/CMakeLists.txt b/examples/activeqt/multiple/CMakeLists.txt index 47759e7..4621b57 100644 --- a/examples/activeqt/multiple/CMakeLists.txt +++ b/examples/activeqt/multiple/CMakeLists.txt @@ -1,21 +1,15 @@ -# Generated from multiple.pro. - cmake_minimum_required(VERSION 3.16) project(multipleax 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}/activeqt/multiple") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_library(multipleax ax1.h @@ -24,6 +18,7 @@ qt6_add_axserver_library(multipleax multipleax.def multipleax.rc ) + target_link_libraries(multipleax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/opengl/CMakeLists.txt b/examples/activeqt/opengl/CMakeLists.txt index 0be0978..f98042d 100644 --- a/examples/activeqt/opengl/CMakeLists.txt +++ b/examples/activeqt/opengl/CMakeLists.txt @@ -1,21 +1,15 @@ -# Generated from opengl.pro. - cmake_minimum_required(VERSION 3.16) project(openglax 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}/activeqt/opengl") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer OpenGL OpenGLWidgets) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui OpenGL OpenGLWidgets Widgets) qt6_add_axserver_executable(openglax glbox.cpp glbox.h @@ -24,6 +18,7 @@ qt6_add_axserver_executable(openglax opengl.def opengl.rc ) + target_link_libraries(openglax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/qutlook/CMakeLists.txt b/examples/activeqt/qutlook/CMakeLists.txt index e335f7e..3e56837 100644 --- a/examples/activeqt/qutlook/CMakeLists.txt +++ b/examples/activeqt/qutlook/CMakeLists.txt @@ -1,24 +1,15 @@ -# Generated from qutlook.pro. - cmake_minimum_required(VERSION 3.16) project(qutlook 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}/activeqt/qutlook") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS AxContainer) +find_package(Qt6 REQUIRED COMPONENTS AxContainer Core Gui Widgets) qt_add_executable(qutlook addressview.cpp addressview.h diff --git a/examples/activeqt/simple/CMakeLists.txt b/examples/activeqt/simple/CMakeLists.txt index 1bc4f9c..dbd071d 100644 --- a/examples/activeqt/simple/CMakeLists.txt +++ b/examples/activeqt/simple/CMakeLists.txt @@ -1,26 +1,21 @@ -# Generated from simple.pro. - cmake_minimum_required(VERSION 3.16) project(simpleax 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}/activeqt/simple") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_executable(simpleax main.cpp simple.def simple.rc ) + target_link_libraries(simpleax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/simpleqml/CMakeLists.txt b/examples/activeqt/simpleqml/CMakeLists.txt index c26c956..ff487b9 100644 --- a/examples/activeqt/simpleqml/CMakeLists.txt +++ b/examples/activeqt/simpleqml/CMakeLists.txt @@ -1,26 +1,21 @@ -# Generated from simpleqml.pro. - cmake_minimum_required(VERSION 3.16) project(simpleqmlax 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}/activeqt/simpleqml") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer Quick QuickWidgets) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Quick QuickWidgets Widgets) qt6_add_axserver_library(simpleqmlax main.cpp simpleqml.def simpleqml.rc ) + target_link_libraries(simpleqmlax PUBLIC Qt::Core Qt::Gui diff --git a/examples/activeqt/wrapper/CMakeLists.txt b/examples/activeqt/wrapper/CMakeLists.txt index 5b17989..f89b7e4 100644 --- a/examples/activeqt/wrapper/CMakeLists.txt +++ b/examples/activeqt/wrapper/CMakeLists.txt @@ -1,27 +1,22 @@ -# Generated from wrapper.pro. - cmake_minimum_required(VERSION 3.16) project(wrapperax 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}/activeqt/wrapper") -find_package(Qt6 COMPONENTS Core Gui Widgets AxServer) +find_package(Qt6 REQUIRED COMPONENTS AxServer Core Gui Widgets) qt6_add_axserver_library(wrapperax main.cpp wrapperax.def wrapperax.rc ) + target_link_libraries(wrapperax PUBLIC Qt::Core Qt::Gui |