diff --git a/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt index e2505f60ab..b3e17aea2c 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt +++ b/tests/auto/corelib/plugin/qlibrary/lib/CMakeLists.txt @@ -30,27 +30,27 @@ 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 - $ - "${CMAKE_CURRENT_BINARY_DIR}/../" - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_CURRENT_BINARY_DIR}/*dylib" - "${CMAKE_CURRENT_BINARY_DIR}/../") -elseif (UNIX) - if (NOT ANDROID) +if(UNIX) + if(APPLE) add_custom_command(TARGET mylib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ - "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1.0.0" + $ + "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.1.0.0.dylib" COMMAND ${CMAKE_COMMAND} -E create_symlink - "libmylib.so.1.0.0" - "${CMAKE_CURRENT_BINARY_DIR}/../libmylib.so.1" + "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 + $ + "${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.so1" + "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, @@ -64,10 +64,10 @@ elseif (UNIX) endif() else() #Win32 add_custom_command(TARGET mylib POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${CMAKE_CURRENT_BINARY_DIR}/../mylib.dll" - VERBATIM) + VERBATIM) endif() # special case end diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt b/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt index f03b3d5268..cb9ce49239 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt +++ b/tests/auto/corelib/plugin/qlibrary/lib2/CMakeLists.txt @@ -42,8 +42,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 + $ + "${CMAKE_CURRENT_BINARY_DIR}/../system.qt.test.mylib.so.dylib" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ + "${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 $