mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 07:45:30 +08:00
qt 6.5.1 original
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(test_interface_link_libraries)
|
||||
|
||||
find_package(Qt6Gui REQUIRED)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
add_library(somelib SHARED somelib.cpp)
|
||||
generate_export_header(somelib)
|
||||
set_property(TARGET somelib PROPERTY LINK_LIBRARIES Qt::Gui)
|
||||
set_property(TARGET somelib PROPERTY INTERFACE_LINK_LIBRARIES Qt::Gui)
|
||||
|
||||
add_executable(mainexe main.cpp)
|
||||
set_property(TARGET mainexe PROPERTY LINK_LIBRARIES somelib)
|
10
tests/auto/cmake/test_interface_link_libraries/main.cpp
Normal file
10
tests/auto/cmake/test_interface_link_libraries/main.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "somelib.h"
|
||||
|
||||
int main(int,char**)
|
||||
{
|
||||
SomeObject so;
|
||||
return so.value();
|
||||
}
|
14
tests/auto/cmake/test_interface_link_libraries/somelib.cpp
Normal file
14
tests/auto/cmake/test_interface_link_libraries/somelib.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "somelib.h"
|
||||
|
||||
SomeObject::SomeObject(QObject *parent)
|
||||
: QTextDocument(parent)
|
||||
{
|
||||
}
|
||||
|
||||
int SomeObject::value()
|
||||
{
|
||||
return 0;
|
||||
}
|
20
tests/auto/cmake/test_interface_link_libraries/somelib.h
Normal file
20
tests/auto/cmake/test_interface_link_libraries/somelib.h
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#ifndef SOMELIB_H
|
||||
#define SOMELIB_H
|
||||
|
||||
#include "somelib_export.h"
|
||||
|
||||
#include <QTextDocument>
|
||||
|
||||
class SOMELIB_EXPORT SomeObject : QTextDocument
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SomeObject(QObject *parent = nullptr);
|
||||
|
||||
int value();
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user