Posted on 11-08-2016
Filed Under (Technology) by bigbang

While writing program on Mac, sometimes we need to link framework and libraries under OSX folder System/Library/Frameworks. There are so many frameworks like CoreMedia & VideoToolBox, which you will use in FFMpeg or something else someday.

In this situation, we have to use find_library as it includes some special handling for frameworks on OSX.

Also, don’t use link_directories, CMake use full paths to libraries and it’s not needed.

Here’s some simple example with CoreMedia:

find_library(CORE_MEDIA CoreMedia)
if (NOT CORE_MEDIA)
    message(FATAL_ERROR "CoreMedia not found")
endif()

add_executable(program ${program_SOURCES})
target_link_libraries(program ${CORE_MEDIA})

© 2016, The Big Bang on Reading Busy. All rights reserved.
On republishing this post you must provide link to the original post.

(0) Comments    (152) Views    Read More   
Post a Comment
Name:
Email:
Website:
Comments: