diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-02-19 20:00:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-21 22:41:05 +0100 |
commit | 7477d50fce9a0008ff4e050285e146ebc0c1e163 (patch) | |
tree | e52f377df3918f00c32d509a76639eee0b56f0f0 /tests/auto | |
parent | 057fabab7cbcb6b278771e1336c3a82f64106b2d (diff) |
Populate the cmake variables only one time.
Since we're only including the Extras file one time, invoking set() for
the include dirs again will overwrite the addition of include dirs in
the extras file.
We only need to populate these variables if not set anyway, so do that.
Change-Id: I04dad0674778e79c8c12c18231b8ce6c92edf881
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto')
3 files changed, 54 insertions, 0 deletions
diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt index dfac4ca3be..c0fdfd6b9a 100644 --- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt @@ -5,5 +5,9 @@ project(test_multiple_find_package) find_package(Qt5Core REQUIRED) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + add_subdirectory(subdir1) +add_executable(exe1 "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp") +include_directories(${Qt5Core_INCLUDE_DIRS}) diff --git a/tests/auto/cmake/test_multiple_find_package/main.cpp b/tests/auto/cmake/test_multiple_find_package/main.cpp new file mode 100644 index 0000000000..82f1109395 --- /dev/null +++ b/tests/auto/cmake/test_multiple_find_package/main.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** 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 <QtCore/QString> + +int main(int,char**) +{ + return 0; +} diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt index 86c05f5de5..0c7a113f50 100644 --- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt @@ -1,2 +1,5 @@ find_package(Qt5Core REQUIRED) + +add_executable(exe2 "${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp") +include_directories(${Qt5Core_INCLUDE_DIRS}) |