Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,100
    • Issues 4,100
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #21387
Closed
Open
Issue created Nov 01, 2020 by Steve Robinson@ssrobinsContributor

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: framework_search_path

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

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking