Hi Daniel,

I've just been using:

target_link_libraries (TargetName "-framework IOKit")

Which has been working perfectly for me. Then again, I am only trying to add 
frameworks that are part of the OS. I haven't yet tried building my own 
frameworks and linking those in.

Parag Chandra
Software Engineer, Mobile Team
Mobile: +1.919.824.1410

[https://www.ionicsecurity.com/IonicSigHz.png]<https://ionic.com>

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309











From: Daniel Kollmann <[email protected]<mailto:[email protected]>>
Date: Sunday, January 25, 2015 at 7:43 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: [CMake] Xcode does not link against frameworks

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 <[email protected]<mailto:[email protected]>>
Datum: Samstag, 24. Januar 2015 12:25
An: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to