summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in4
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in5
-rw-r--r--tests/auto/cmake/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt21
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/main.cpp48
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/somelib.cpp52
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/somelib.h58
7 files changed, 191 insertions, 1 deletions
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index c4b58fe7d7..2ffb980156 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -57,11 +57,13 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
- \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+ \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
!!IF !isEmpty(CMAKE_LIB_SONAME)
\"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
!!ENDIF
+ # For backward compatibility with CMake < 2.8.12
+ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
)
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index e01b448351..db482fa9e6 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -134,6 +134,11 @@ if (NOT TARGET Qt5::WinMain)
get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS)
foreach(_config ${_configs})
set_property(TARGET Qt5::Core APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
+ )
+ # For backward compatibility with CMake < 2.8.12
+ set_property(TARGET Qt5::Core APPEND PROPERTY
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
)
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 0f794915ee..c8f4efe7db 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -129,3 +129,7 @@ expect_pass(test_opengl_lib)
if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
expect_pass(test_interface)
endif()
+
+if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
+ expect_pass(test_interface_link_libraries)
+endif()
diff --git a/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt
new file mode 100644
index 0000000000..d747a43c4a
--- /dev/null
+++ b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_interface_link_libraries)
+
+find_package(Qt5Gui REQUIRED)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+cmake_policy(SET CMP0022 NEW)
+
+include(GenerateExportHeader)
+
+add_library(somelib SHARED somelib.cpp)
+generate_export_header(somelib)
+set_property(TARGET somelib PROPERTY LINK_LIBRARIES Qt5::Gui)
+set_property(TARGET somelib PROPERTY INTERFACE_LINK_LIBRARIES Qt5::Gui)
+
+add_executable(mainexe main.cpp)
+set_property(TARGET mainexe PROPERTY LINK_LIBRARIES somelib)
diff --git a/tests/auto/cmake/test_interface_link_libraries/main.cpp b/tests/auto/cmake/test_interface_link_libraries/main.cpp
new file mode 100644
index 0000000000..4ea2204d38
--- /dev/null
+++ b/tests/auto/cmake/test_interface_link_libraries/main.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "somelib.h"
+
+int main(int,char**)
+{
+ SomeObject so;
+ return so.value();
+}
diff --git a/tests/auto/cmake/test_interface_link_libraries/somelib.cpp b/tests/auto/cmake/test_interface_link_libraries/somelib.cpp
new file mode 100644
index 0000000000..633540b164
--- /dev/null
+++ b/tests/auto/cmake/test_interface_link_libraries/somelib.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "somelib.h"
+
+SomeObject::SomeObject(QObject *parent)
+ : QTextDocument(parent)
+{
+}
+
+int SomeObject::value()
+{
+ return 0;
+}
diff --git a/tests/auto/cmake/test_interface_link_libraries/somelib.h b/tests/auto/cmake/test_interface_link_libraries/somelib.h
new file mode 100644
index 0000000000..76b35b6b6a
--- /dev/null
+++ b/tests/auto/cmake/test_interface_link_libraries/somelib.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SOMELIB_H
+#define SOMELIB_H
+
+#include "somelib_export.h"
+
+#include <QTextDocument>
+
+class SOMELIB_EXPORT SomeObject : QTextDocument
+{
+ Q_OBJECT
+public:
+ explicit SomeObject(QObject *parent = 0);
+
+ int value();
+};
+
+#endif