Issue
At some point cmake stopped finding OpenGL with this error message
Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)
Then I set CMAKE_FIND_DEBUG_MODE
to true, and then I realized that cmake is not looking in the frameworks folder
message("${CMAKE_FRAMEWORK_PATH}")
prints empty string
After setting CMAKE_FRAMEWORK_PATH
to /System/Library/Frameworks
cmake still fails to find OpenGL
Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR)
Therefore, I have two questions:
- Why CMAKE_FRAMEWORK_PATH is an empty string (should it be?)
- Why CMake does not find OpenGL headers even if I specify the frameworks folder
Solution
The problem was that I was trying to call find_package before project in my CMakeLists.txt
reordering lines of code in this way:
project("name")
find_package(OpenGL REQUIRED)
solved my problem
Answered By - kin4stat Answer Checked By - Timothy Miller (WPSolving Admin)