[CMake] Xcode does not link against frameworks

Daniel Kollmann dankolle at mail.de
Sun Jan 25 07:43:13 EST 2015


I took a closer look at the problem and while as I said the libraries are
correctly found, when I look at the project file, I see this:

OTHER_LDFLAGS = " -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-framework Accelerate -framework Accelerate -framework Accelerate -framework
Accelerate -framework Accelerate -framework Accelerate -framework Accelerate
-framework Accelerate -framework Accelerate -framework Accelerate -framework
Accelerate -framework Accelerate -framework Accelerate -framework Accelerate

My calls to the function look like this:

add_framework(${target} Accelerate)
add_framework(${target} AudioToolbox)
add_framework(${target} Carbon)
add_framework(${target} Cocoa)
add_framework(${target} CoreAudio)
add_framework(${target} CoreFoundation)
add_framework(${target} CoreMIDI)
add_framework(${target} DiscRecording)
add_framework(${target} IOKit)
add_framework(${target} OpenGL)
add_framework(${target} QTKit)
add_framework(${target} QuartzCore)
add_framework(${target} QuickTime)
add_framework(${target} WebKit)

Shouldn¹t ${found} be locally inside the function and is it not safe to call
target_link_libraries several times?

Thanks for any advice
Dan


Von:  Daniel Kollmann <dankolle at mail.de>
Datum:  Samstag, 24. Januar 2015 12:25
An:  "cmake at cmake.org" <cmake at cmake.org>
Betreff:  Xcode does not link against frameworks

Hello,

I add my required frameworks through this function of mine:

function(add_framework target framework)
    if(APPLE)
        find_library(found ${framework})

        if(${found} STREQUAL "${framework}-NOTFOUND³)
            message(FATAL_ERROR "ERROR: ${framework} not found
(${CMAKE_OSX_SYSROOT})")
        endif()

        #message("Found framework ${found}")

        target_link_libraries(${target} ${found})
    endif()
endfunction()

The framework is correctly found and added but still Xcode does neither list
the frameworks as a build phase nor link against them. All symbols appear as
missing.

Maybe there is another step required to include the framework for Xcode.

I am using Cmake 3.1.1

Thanks for the help
Dan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150125/d1d09f51/attachment-0001.html>


More information about the CMake mailing list