I am trying to generate a Xcode project with cmake, but I can’t define “Other linker flags” in project settings.
I have used “target_link_libraries” but it doesn’t work.
Any clue?
What I want to do is to define which libraries must be included on linking. If I do manually, I put “-lopencv_core” for example.
I am trying to generate a Xcode project with cmake, but I can’t define
Share
The *target_link_libraries* should handle it for you. If you aren’t already using the FindOpenCV.cmake module to locate the libraries that is likely the problem and you should try that next. To do this, first get the FindOpenCV.cmake file and place it on your project path (typically {project_dir}/cmake/Modules) and add the following line to your CMakeLists.txt:
This will tell CMake to use the custom FindOpenCV.cmake when resolving libraries. Then add:
Although you shouldn’t need to you can set linker flags via CMAKE_SHARED_LINKER_FLAGS.