summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qlibrary/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/plugin/qlibrary/lib')
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt69
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/mylib.c29
2 files changed, 35 insertions, 63 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
index 6bdd30ab17..1a318e1483 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
+++ b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from lib.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## mylib Generic Library:
@@ -7,14 +8,12 @@
qt_internal_add_cmake_library(mylib
SHARED
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qlibrary"
- #OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" # special case
SOURCES
mylib.c
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
)
-# special case begin
set_target_properties(mylib PROPERTIES
VERSION 1.0.0
SOVERSION 1
@@ -27,41 +26,45 @@ if(WIN32)
set_property(TARGET mylib PROPERTY PREFIX "")
endif()
-
-if (MACOS)
- add_custom_command(TARGET mylib POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- $<TARGET_FILE:mylib>
- "${CMAKE_CURRENT_BINARY_DIR}/../"
+if(UNIX)
+ if(APPLE)
+ add_custom_command(TARGET mylib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${CMAKE_CURRENT_BINARY_DIR}/*dylib"
- "${CMAKE_CURRENT_BINARY_DIR}/../"
- )
-elseif (UNIX)
- add_custom_command(TARGET mylib POST_BUILD
+ $<TARGET_FILE:mylib>
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.1.0.0.dylib"
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ "libmylib.1.0.0.dylib"
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.1.dylib"
+ VERBATIM)
+ elseif(NOT ANDROID)
+ add_custom_command(TARGET mylib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
- $<TARGET_FILE:mylib>
- "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1.0.0"
+ $<TARGET_FILE:mylib>
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1.0.0"
COMMAND ${CMAKE_COMMAND} -E create_symlink
- "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1.0.0"
- "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1"
+ "libmylib.so.1.0.0"
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1"
COMMAND ${CMAKE_COMMAND} -E create_symlink
- "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1.0.0"
- "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so1"
- )
+ "libmylib.so.1.0.0"
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so1"
+ VERBATIM)
+ else()
+ # Android does not use symlinks. Also, according to our conventions,
+ # libraries on Android MUST be named in the following pattern:
+ # lib*.so
+ add_custom_command(TARGET mylib POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ $<TARGET_FILE:mylib>
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so"
+ VERBATIM)
+ endif()
else() #Win32
add_custom_command(TARGET mylib POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:mylib>
"${CMAKE_CURRENT_BINARY_DIR}/../mylib.dll"
- )
+ VERBATIM)
endif()
-# special case end
-
-#### Keys ignored in scope 1:.:.:lib.pro:<TRUE>:
-# INSTALLS = "target"
-# TEMPLATE = "lib"
-# target.path = "$$[QT_INSTALL_TESTS]/tst_qlibrary"
## Scopes:
#####################################################################
@@ -70,9 +73,3 @@ qt_internal_extend_target(mylib CONDITION MSVC
DEFINES
WIN32_MSVC
)
-
-#### Keys ignored in scope 4:.:.:lib.pro:(CMAKE_BUILD_TYPE STREQUAL Debug):
-# DESTDIR = "../debug/"
-
-#### Keys ignored in scope 5:.:.:lib.pro:else:
-# DESTDIR = "../release/"
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
index 419c22a446..61fe52d182 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
+++ b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qglobal.h>