diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 16:14:26 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-21 10:25:16 +0100 |
commit | 995779435381bbdc63f80a0a0c8fa709a4c92362 (patch) | |
tree | 0ab622796f06da06343f156ccd07555b81efc6ce /examples/nfc/ndefeditor | |
parent | e91c9ce06c92df424e2fd6d8acda1a4eda843923 (diff) |
Improve examples CMakeLists.txt
- 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
Pick-to: 6.3
Change-Id: If1935beb09edd873c45842ae06d0f41267a9b36a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/nfc/ndefeditor')
-rw-r--r-- | examples/nfc/ndefeditor/CMakeLists.txt | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/nfc/ndefeditor/CMakeLists.txt b/examples/nfc/ndefeditor/CMakeLists.txt index ca715864..c05da2d5 100644 --- a/examples/nfc/ndefeditor/CMakeLists.txt +++ b/examples/nfc/ndefeditor/CMakeLists.txt @@ -1,22 +1,16 @@ cmake_minimum_required(VERSION 3.16) project(ndefeditor 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}/nfc/ndefeditor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Nfc) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Nfc Widgets) qt_add_executable(ndefeditor MANUAL_FINALIZATION @@ -26,10 +20,12 @@ qt_add_executable(ndefeditor textrecordeditor.cpp textrecordeditor.h textrecordeditor.ui urirecordeditor.cpp urirecordeditor.h urirecordeditor.ui ) + set_target_properties(ndefeditor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(ndefeditor PUBLIC Qt::Core Qt::Gui |