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/.prev_CMakeLists.txt34
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt62
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/lib.pro21
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/mylib.c29
4 files changed, 46 insertions, 100 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/.prev_CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib/.prev_CMakeLists.txt
deleted file mode 100644
index b1435b77d3..0000000000
--- a/tests/auto/corelib/plugin/qlibrary/lib/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated from lib.pro.
-
-#####################################################################
-## mylib Generic Library:
-#####################################################################
-
-qt_add_cmake_library(mylib
- SHARED
- INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qlibrary"
- OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
- SOURCES
- mylib.c
- PUBLIC_LIBRARIES
- Qt::Core
-)
-
-#### Keys ignored in scope 1:.:.:lib.pro:<TRUE>:
-# INSTALLS = "target"
-# TEMPLATE = "lib"
-# target.path = "$$[QT_INSTALL_TESTS]/tst_qlibrary"
-
-## Scopes:
-#####################################################################
-
-qt_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/CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
index 41bd6bf252..1a318e1483 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
+++ b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt
@@ -1,20 +1,19 @@
-# Generated from lib.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## mylib Generic Library:
#####################################################################
-qt_add_cmake_library(mylib
+qt_internal_add_cmake_library(mylib
SHARED
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qlibrary"
- OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
SOURCES
mylib.c
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
)
-# special case begin
set_target_properties(mylib PROPERTIES
VERSION 1.0.0
SOVERSION 1
@@ -27,23 +26,50 @@ if(WIN32)
set_property(TARGET mylib PROPERTY PREFIX "")
endif()
-# special case end
-
-#### Keys ignored in scope 1:.:.:lib.pro:<TRUE>:
-# INSTALLS = "target"
-# TEMPLATE = "lib"
-# target.path = "$$[QT_INSTALL_TESTS]/tst_qlibrary"
+if(UNIX)
+ if(APPLE)
+ add_custom_command(TARGET mylib POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ $<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"
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ "libmylib.so.1.0.0"
+ "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1"
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ "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
+ $<TARGET_FILE:mylib>
+ "${CMAKE_CURRENT_BINARY_DIR}/../mylib.dll"
+ VERBATIM)
+endif()
## Scopes:
#####################################################################
-qt_extend_target(mylib CONDITION MSVC
+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/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro
deleted file mode 100644
index 2c3305e872..0000000000
--- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = lib
-CONFIG += dll
-CONFIG -= staticlib
-SOURCES = mylib.c
-TARGET = mylib
-DESTDIR = ../
-QT = core
-
-msvc: DEFINES += WIN32_MSVC
-
-# This project is testdata for tst_qlibrary
-target.path = $$[QT_INSTALL_TESTS]/tst_qlibrary
-INSTALLS += target
-
-win32:debug_and_release {
- CONFIG(debug, debug|release) {
- DESTDIR = ../debug/
- } 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>