Framework search path not set in CMake 3.19
When using a third-party macOS framework, I set CMAKE_XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS
so Xcode can find the framework and link it to the executable. In CMake 3.18.4, it worked fine, but in 3.19.0-rc2, I get a linker error stating it can't find my framework. When I look in Xcode, the Framework Search Path field in the executable target is blank. Here's a minimal project to repro the issue:
Use this CMakeLists.txt:
cmake_minimum_required(VERSION 3.18)
project(Hello)
set(CMAKE_XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS /path/to/frameworks)
add_executable(add add.cpp)
And a dummy source file for the executable:
int add(int num1, int num2)
{
return num1 + num2;
}
int main()
{
add(1, 1);
return 0;
}
Generate an Xcode project: cmake -G Xcode -B build
The Framework Search Paths field is blank. See below:
If you install CMake 3.18.4 and re-run CMake, the expected /path/to/frameworks
appears in that field.
Reproduced with Xcode 12.1, 11.3.1, and 10.2