Error "Could not parse framework path" when linking against framework that has a multi-config postfix set
Consider the following project on macOS:
cmake_minimum_required(VERSION 3.22)
project(could-not-parse-framework-path)
set(CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG _debug )
add_library(one SHARED one.cpp)
set_target_properties(one PROPERTIES
FRAMEWORK TRUE
)
add_library(two SHARED two.cpp)
set_target_properties(two PROPERTIES
FRAMEWORK TRUE
)
target_link_libraries(two PUBLIC one)
Run CMake on the project like this:
mkdir build
cd build
cmake .. -G"Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES='Release;Debug'
This produces an error:
CMake Error at CMakeLists.txt:12 (target_link_libraries):
Could not parse framework path
"/Volumes/Data/Users/egon/bugreports/QTBUG/106034/build/Debug/one.framework/Versions/A/one_debug"
linked by target two.
This issue appeared with CMake 3.24.0, version 3.23.3 is fine.