FreeBSD 14 - OpenGL, CMake

Hello,

Can someone please point me in the right direction before I completely lose my mind here - I have a cmake project that requires OpenGL, and I have this in my Cmake project file:
Code:
find_package(OpenGL REQUIRED)

Despite installing every conceivable package I can think of (and probably packages I didn't even need to install, I get this):
Code:
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake/Modules/FindOpenGL.cmake:545 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:3 (find_package)

Packages present already on the system:
Code:
xorg
freeglut
libGLU
libglvnd
libosmesa
mesa-devel
mesa-dri
mesa-libs
nvidia-driver

Is /usr/local/share/cmake/Modules/FindOpenGL.cmake broken or am I missing something here? Should I just try and use pkg-config in CMake instead to find the opengl libraries and headers.
 
Also:

Bash:
root@bsd14dev:~ # find /usr/local -name 'libGL.so*'
/usr/local/lib/libGL.so.1
/usr/local/lib/libGL.so.1.7.0
/usr/local/lib/libGL.so

root@bsd14dev:~ # find /usr/local -name 'gl.h'
/usr/local/include/GL/gl.h
/usr/local/include/GLES/gl.h
/usr/local/include/epoxy/gl.h

From what I can tell, everything is there....
 
Looks like something dumb I overlooked... I had find_package in my cmake project before defining the project name. The placement seems to matter. Moving it further down fixed the problem.
 
Back
Top