CMake: Fix project structure of calendarbackendplugin project
Before this change, installing the example with a multi-config generator failed with CMake Error at cmake_install.cmake:123 (include): include could not find requested file: <build_dir>/.qt/deploy_calendarPlugin_49e753a159-$<CONFIG>.cmake When configuring the project, cmake mentions the following warning: CMake Warning (dev) in CMakeLists.txt: Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator expressions. Run "cmake --help-policy CMP0087" for policy details. This happens because the specified minimum cmake version of the project was 3.5, so the above policy was not enabled, and the generator expressions we use for the deployment api failed to be evaluated. Fix the minimum version to be 3.16. Clean up the project a bit to be in line with our other examples. Use qt_internal_add_example, remove redundant find_package(Qt) calls, remove redundant project() and cmake_minimum_required() calls, use target_include_directories. Amends f071d4ee8abf6fd0f1b6e187b4e99fa6fad7b642 Fixes: QTBUG-127616 Task-number: QTBUG-115200 Change-Id: I06ca1d38a8e5e7cb18ade205616a603db98a17be Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
ce7b8fc91d
commit
98847d2153
@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2024 The Qt Company Ltd.
|
# Copyright (C) 2024 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
add_subdirectory(calendarbackendplugin)
|
qt_internal_add_example(calendarbackendplugin)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Copyright (C) 2024 The Qt Company Ltd.
|
# Copyright (C) 2024 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(JulianGregorianCalendar VERSION 0.1 LANGUAGES CXX)
|
project(JulianGregorianCalendar VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core)
|
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
||||||
|
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
|
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
# Copyright (C) 2024 The Qt Company Ltd.
|
# Copyright (C) 2024 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
project(JulianGregorianCalendar VERSION 0.1 LANGUAGES CXX)
|
|
||||||
|
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Core)
|
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Core)
|
|
||||||
|
|
||||||
qt_standard_project_setup()
|
|
||||||
|
|
||||||
include_directories(../common/)
|
|
||||||
|
|
||||||
qt_add_executable(JulianGregorianCalendar
|
qt_add_executable(JulianGregorianCalendar
|
||||||
../common/calendarBackendInterface.h
|
../common/calendarBackendInterface.h
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_include_directories(JulianGregorianCalendar PRIVATE ../common)
|
||||||
|
|
||||||
target_link_libraries(JulianGregorianCalendar
|
target_link_libraries(JulianGregorianCalendar
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
Qt::Core
|
Qt::Core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
# Copyright (C) 2024 The Qt Company Ltd.
|
# Copyright (C) 2024 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
project(calendarPlugin VERSION 0.1 LANGUAGES CXX)
|
|
||||||
|
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Core)
|
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Core)
|
|
||||||
|
|
||||||
qt_standard_project_setup()
|
|
||||||
|
|
||||||
include_directories(../common/)
|
|
||||||
|
|
||||||
qt_add_library(calendarPlugin SHARED
|
qt_add_library(calendarPlugin SHARED
|
||||||
../common/calendarBackendInterface.h
|
../common/calendarBackendInterface.h
|
||||||
calendarplugin.h
|
calendarplugin.h
|
||||||
@ -19,6 +9,8 @@ qt_add_library(calendarPlugin SHARED
|
|||||||
calendarbackend.h
|
calendarbackend.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_include_directories(calendarPlugin PRIVATE ../common)
|
||||||
|
|
||||||
target_link_libraries(calendarPlugin
|
target_link_libraries(calendarPlugin
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
|
Loading…
x
Reference in New Issue
Block a user