alecjacobson / computer-graphics-meshes

Computer Graphics Assignment about Meshes
25 stars 30 forks source link

cmake failed on macOS10.15 #21

Open VivianZ99 opened 5 years ago

VivianZ99 commented 5 years ago

When I try to make and build the program, it keeping failed, and showing an error message: "could not find openGL". I'm guessing this might caused by the new version of the macOS since I just updated it recently. I've tried a lots of ways to solve this issue, but still can not fix it. And here's the error message, how should I do to fix it?

Screen Shot 2019-10-19 at 9 53 06 PM
abhimadan commented 5 years ago

Try xcode-select --install if you haven't done so already.

VivianZ99 commented 5 years ago

Try xcode-select --install if you haven't done so already.

I've already installed it.

abhimadan commented 5 years ago

If you have a CMakeCache.txt in your build folder, that could be pointing to a deprecated version, so try deleting that file and running cmake again. If that isn't your issue, then try running the following command:

find /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ -name OpenGL.framework

If this doesn't find OpenGL, then you don't have OpenGL installed. You might need to manually upgrade Xcode (since apparently that command line tool doesn't work on newer versions).

VivianZ99 commented 5 years ago

If you have a CMakeCache.txt in your build folder, that could be pointing to a deprecated version, so try deleting that file and running cmake again. If that isn't your issue, then try running the following command:

find /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/ -name OpenGL.framework

If this doesn't find OpenGL, then you don't have OpenGL installed. You might need to manually upgrade Xcode (since apparently that command line tool doesn't work on newer versions).

I have downloaded the newest version of Xcode and I can find the framework you mentioned in here:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform//Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework

But still get the same error. I have also tried this command:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

abhimadan commented 5 years ago

Hmm, this is really strange. I think your best bet at this point (if you haven't tried this already) is to look through cmake's logs and see if you can figure anything out. Try deleting your build directory and running cmake --trace .. &> cmake-trace.log, then open cmake-trace.log and find the part where it starts to try to find OpenGL (just searching for "FindOpenGL.cmake" should get you to the right section). With the extra flags, cmake prints a log of its entire execution through the cmake files it reads, so hopefully that should provide some additional information.