diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-09-15 15:09:07 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-09-21 14:14:36 (GMT) |
commit | 0bd3efffbc97783bf8b1a6dcf3132a1bca84dce9 (patch) | |
tree | ce8505ac8a9c7a8e9c09a0ee0af5beebae522682 /Tests | |
parent | 2ce95133d65ed44e69543b286e47d768dbceff2b (diff) | |
download | CMake-0bd3efffbc97783bf8b1a6dcf3132a1bca84dce9.zip CMake-0bd3efffbc97783bf8b1a6dcf3132a1bca84dce9.tar.gz CMake-0bd3efffbc97783bf8b1a6dcf3132a1bca84dce9.tar.bz2 |
Genex LINK_LIBRARY: Add support for framework with postfix
Diffstat (limited to 'Tests')
3 files changed, 42 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index db4200b..d802e1f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -697,6 +697,8 @@ add_RunCMake_test(target_link_libraries-LINK_LIBRARY -DCMAKE_SYSTEM_NAME=${CMAKE -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION} -DMSVC_VERSION=${MSVC_VERSION} + -DXCODE=${XCODE} + -DXCODE_VERSION=${XCODE_VERSION} -DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX} -DCMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX} -DCMAKE_IMPORT_LIBRARY_PREFIX=${CMAKE_IMPORT_LIBRARY_PREFIX} diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake index 021de41..9b6581c 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake @@ -90,12 +90,22 @@ if(APPLE AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES run_cmake_target(apple_framework target-framework main-target-framework) run_cmake_target(apple_framework target-reexport_framework main-target-reexport_framework) run_cmake_target(apple_framework target-weak_framework main-target-weak_framework) + + if(RunCMake_GENERATOR_IS_MULTI_CONFIG AND (NOT XCODE OR XCODE_VERSION GREATER_EQUAL 13)) + run_cmake_target(apple_framework target-framework-postfix main-target-framework-postfix) + run_cmake_target(apple_framework target-reexport_framework-postfix main-target-reexport_framework-postfix) + run_cmake_target(apple_framework target-weak_framework-postfix main-target-weak_framework-postfix) + endif() endif() if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION GREATER_EQUAL "12") run_cmake_target(apple_framework needed_framework main-needed_framework) run_cmake_target(apple_framework target-needed_framework main-target-needed_framework) + + if(RunCMake_GENERATOR_IS_MULTI_CONFIG AND (NOT XCODE OR XCODE_VERSION GREATER_EQUAL 13)) + run_cmake_target(apple_framework target-needed_framework-postfix main-target-needed_framework-postfix) + endif() endif() # Apple library features diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/apple_framework.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/apple_framework.cmake index e9a93e9..ca0e72d 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/apple_framework.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/apple_framework.cmake @@ -59,3 +59,33 @@ target_link_libraries(main-target-reexport_framework PRIVATE "$<LINK_LIBRARY:FRA # feature WEAK_FRAMEWORK add_executable(main-target-weak_framework main.mm) target_link_libraries(main-target-weak_framework PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>" "$<LINK_LIBRARY:REEXPORT_FRAMEWORK,target-framework>") + + + +get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTI_CONFIG) + add_library(target-framework-postfix SHARED foo.mm) + set_target_properties(target-framework-postfix PROPERTIES FRAMEWORK TRUE + FRAMEWORK_MULTI_CONFIG_POSTFIX_RELEASE "_release") + target_link_libraries(target-framework-postfix PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>") + + + # feature FRAMEWORK + add_executable(main-target-framework-postfix main.mm) + target_link_libraries(main-target-framework-postfix PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>" "$<LINK_LIBRARY:FRAMEWORK,target-framework-postfix>") + + + # feature NEEDED_FRAMEWORK + add_executable(main-target-needed_framework-postfix main.mm) + target_link_libraries(main-target-needed_framework-postfix PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>" "$<LINK_LIBRARY:NEEDED_FRAMEWORK,target-framework-postfix>") + + + # feature REEXPORT_FRAMEWORK + add_executable(main-target-reexport_framework-postfix main.mm) + target_link_libraries(main-target-reexport_framework-postfix PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>" "$<LINK_LIBRARY:REEXPORT_FRAMEWORK,target-framework-postfix>") + + + # feature WEAK_FRAMEWORK + add_executable(main-target-weak_framework-postfix main.mm) + target_link_libraries(main-target-weak_framework-postfix PRIVATE "$<LINK_LIBRARY:FRAMEWORK,Foundation>" "$<LINK_LIBRARY:REEXPORT_FRAMEWORK,target-framework-postfix>") +endif() |