diff options
Diffstat (limited to 'tests/auto/corelib/plugin/qlibrary/lib2')
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt | 66 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/lib2/mylib.c | 2 |
2 files changed, 29 insertions, 39 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt index 902c53ea84..f6bdeb453a 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt +++ b/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt @@ -1,20 +1,20 @@ -# Generated from lib2.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## mylib Generic Library: ##################################################################### -qt_internal_add_cmake_library(mylib2 # special case +qt_internal_add_cmake_library(mylib2 SHARED INSTALL_DIRECTORY "${INSTALL_TESTSDIR}tst_qlibrary" - #OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" # special case + #OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" SOURCES mylib.c - PUBLIC_LIBRARIES + LIBRARIES Qt::Core ) -# special case begin # This test is very "annoying" to get working with CMake as it involves having # two targets with the same name on the parent scope, which is not possible with # CMake. Furthermore, on UNIX, this version of the library should override the @@ -39,8 +39,28 @@ if(WIN32) set_property(TARGET mylib2 PROPERTY PREFIX "") endif() -if (UNIX) - if(NOT ANDROID) +if(UNIX) + if(APPLE) + add_custom_command(TARGET mylib2 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $<TARGET_FILE:mylib2> + "${CMAKE_CURRENT_BINARY_DIR}/../system.qt.test.mylib.so.dylib" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $<TARGET_FILE:mylib2> + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.2.0.0.dylib" + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libmylib.2.0.0.dylib" + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.2.dylib" + COMMAND ${CMAKE_COMMAND} -E remove + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.dylib" + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libmylib.2.0.0.dylib" + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.dylib" + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libmylib.2.0.0.dylib" + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so2.dylib" + VERBATIM) + elseif(NOT ANDROID) add_custom_command(TARGET mylib2 POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:mylib2> @@ -80,41 +100,11 @@ else() #Win32 "${CMAKE_CURRENT_BINARY_DIR}/../mylib.dl2" VERBATIM) endif() -# special case end - -#### Keys ignored in scope 1:.:.:lib2.pro:<TRUE>: -# INSTALLS = "target" "renamed_target" -# QMAKE_POST_LINK = "$$member(QMAKE_POST_LINK, 0, -2)" -# TEMPLATE = "lib" -# VERSION = "2" -# renamed_target.extra = "$$member(renamed_target.extra, 0, -2)" -# renamed_target.path = "$$target.path" -# target.path = "$$[QT_INSTALL_TESTS]$${QMAKE_DIR_SEP}tst_qlibrary" ## Scopes: ##################################################################### -qt_internal_extend_target(mylib2 CONDITION MSVC # special case +qt_internal_extend_target(mylib2 CONDITION MSVC DEFINES WIN32_MSVC ) - -#### Keys ignored in scope 3:.:.:lib2.pro:WIN32: -# DESTDIR = "../$$BUILD_FOLDER/" -# files = "$$BUILD_FOLDER$${QMAKE_DIR_SEP}mylib.dl2" "$$BUILD_FOLDER$${QMAKE_DIR_SEP}system.qt.test.mylib.dll" - -#### Keys ignored in scope 4:.:.:lib2.pro:(CMAKE_BUILD_TYPE STREQUAL Debug): -# BUILD_FOLDER = "debug" - -#### Keys ignored in scope 5:.:.:lib2.pro:else: -# BUILD_FOLDER = "release" - -#### Keys ignored in scope 6:.:.:lib2.pro:TEMPLATE___contains___vc._x_: -# src = "$(TargetPath)" - -#### Keys ignored in scope 7:.:.:lib2.pro:else: -# src = "$(DESTDIR_TARGET)" - -#### Keys ignored in scope 8:.:.:lib2.pro:else: -# files = "libmylib.so2" "system.qt.test.mylib.so" -# src = "$(DESTDIR)$(TARGET)" diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c index d036a1ae93..5312a9355b 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c +++ b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qglobal.h> |