From ee50096830f7915db2078ad66d83283e3c97f5d9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 8 Jul 2013 12:17:35 +0200 Subject: Populate INTERFACE_LINK_LIBRARIES property in the cmake files. This is new in CMake 2.8.12 and replaces the old properties matching IMPORTED_INTERFACE_LINK_LIBRARIES_. Change-Id: I5d4c454972f2535f6792e95718c73d80c56ac24c Reviewed-by: Stephen Kelly --- tests/auto/cmake/CMakeLists.txt | 4 ++ .../test_interface_link_libraries/CMakeLists.txt | 21 ++++++++ .../cmake/test_interface_link_libraries/main.cpp | 48 ++++++++++++++++++ .../test_interface_link_libraries/somelib.cpp | 52 +++++++++++++++++++ .../cmake/test_interface_link_libraries/somelib.h | 58 ++++++++++++++++++++++ 5 files changed, 183 insertions(+) create mode 100644 tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt create mode 100644 tests/auto/cmake/test_interface_link_libraries/main.cpp create mode 100644 tests/auto/cmake/test_interface_link_libraries/somelib.cpp create mode 100644 tests/auto/cmake/test_interface_link_libraries/somelib.h (limited to 'tests/auto/cmake') 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 +** 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 +** 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 +** 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 + +class SOMELIB_EXPORT SomeObject : QTextDocument +{ + Q_OBJECT +public: + explicit SomeObject(QObject *parent = 0); + + int value(); +}; + +#endif -- cgit v1.2.3