1

i am trying to install opencv on my Mac IOS and there is this step of Adding an SDK path to CMAKE_OSX_SYSROOT, it will look something like this /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk. and Add x86_64 to CMAKE_OSX_ARCHITECTURES, but don't know how to do it

a''
  • 2,322
  • 2
  • 23
  • 34
ner
  • 711
  • 3
  • 13
  • 30

1 Answers1

2

I'm assuming you're already in the CMAKE application and you're following either one of these sets of directions.

Possible Instructions:

Given which steps you isolated, I'm assuming you also know how to check and uncheck boxes in the CMAKE window. To enter text, you just right click in the empty space ("value" section) to the right of the variable of interest. When I came across this step, the thing which tripped me up was confirming the path/determining the right thing to enter in the window.* TLDR: it turned out to be almost the same thing (for me at least) "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk."

To find your path you need to navigate to that folder WITHIN THE TERMINAL! (Using Apple's Spotlight Search (command + space bar) or using finder windows just won't work. Because they don't see "inside" the Xcode application within the Applications folder. Assuming your home directory is't at the root, you need to keep entering cd .. until you get to the section that outputs the following:

>>>/ $ls -1
Applications
Library
Network
System
User Information
Users
Volumes
anaconda
...

Then you change directories ..., and see what's inside...

>>> $cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
>>> SDKs $ls
MacOSX10.11.sdk

Combine the path with whatever you find in your SDKs folder and you're done (see caveat below)!

Additional Caveat: Those instructions don't say explicitely, but at the end of the whole CMake process, you have to copy the ...opencv/SharedLibs/lib/cv2.so file to your directory of python packages: home/usr/.../lib/python2.7/dist-packages/cv2.so. Based on the advice found here, I installed the cv2.so file from the SharedLibs folder instead of the StaticLibs folder and it worked.

*I tried doing a spotlight serach for the "Developer" folder or "Xcode.app" and nothing was coming up! I thought that folder/path didn't exist and googling around for "CMAKE_OSX_SYSROOT" with "Python" or with "opencv" and a whole bunch of other things made me think the problem was every more of a jumbled mess and problematic.

Community
  • 1
  • 1
Afflatus
  • 2,302
  • 5
  • 25
  • 40