openglonmetal / MGL

OpenGL 4.6 on Metal
Apache License 2.0
769 stars 30 forks source link

CMake build issues on Apple M2 Pro running Ventura 13.5 macOS #78

Open WizzerWorks opened 5 months ago

WizzerWorks commented 5 months ago

I attempted to build using CMake on a Apple M2 Pro laptop running Ventura 13.5 macOS.

I see the following error from build directory

% cmake .. CMake Warning (dev) at CMakeLists.txt:1 (project): cmake_minimum_required() should be called prior to this top-level project() call. Please see the cmake-commands(7) manual for usage documentation of both commands. This warning is for project developers. Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 15.0.0.15000040 -- The CXX compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:27 (find_package): By not providing "Findglm.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "glm", but CMake did not find one.

Could not find a package configuration file provided by "glm" with any of the following names:

glmConfig.cmake
glm-config.cmake

Add the installation prefix of "glm" to CMAKE_PREFIX_PATH or set "glm_DIR" to a directory containing one of the above files. If "glm" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!

WizzerWorks commented 5 months ago

cmake version 3.28.4

nroduit commented 5 months ago

The same issue with Mac M1 14.4.1 with cmake 3.27.3

darkaegisagain commented 5 months ago

CMAKE is the right tool to use but nearly all my development used Xcode as a build platform, so I’m not really familiar with any issues with CMAKE.MikeSent from my iPhoneOn Mar 28, 2024, at 7:05 AM, Nicolas Roduit @.***> wrote: The same issue with Mac M1 14.4.1 with cmake 3.27.3

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

WizzerWorks commented 5 months ago

CMakeLists.txt shows dependencies:

find_package(glm REQUIRED) find_package(OpenGL REQUIRED)

OpenGL is not on my M2 Ventura 13.5 platform. If this is a port on top of Metal, then I would not expect OpenGL to be required at all. If it is for header files, then the header file should be provided separately (not from package).

darkaegisagain commented 5 months ago

Maybe open gl is needed for gli_context.h?MikeSent from my iPhoneOn Mar 29, 2024, at 12:52 PM, Mark Millard @.***> wrote: CMakeLists.txt shows dependencies: find_package(glm REQUIRED) find_package(OpenGL REQUIRED) OpenGL is not on my M2 Ventura 13.5 platform. If this is a port on top of Metal, then I would not expect OpenGL to be required at all. If it is for header files, then the header file should be provided separately (not from package).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

WizzerWorks commented 3 months ago

I was able to get MGL to build through a combination of CMake and Xcode. I've forked MGL to look at using it for building Coin on Apple Silicon. I created a wiki in forked MGL. Cmake was used for externals and Xcode for MGL and GLFW.

julcst commented 2 months ago

I tried to rewrite the build system to use CMake + FetchContent instead of Xcode + Shell scripts: https://github.com/julcst/MGL.git

It builds and compiles successfully in VSCode without Errors but some of the tests are unfortunately broken, especially the texture tests and the uniform tests. If anyone has an idea why that could be I would greatly appreciate it. Maybe this occurs because I deleted a lot of files that seemed unnecessary:

I also replaced all the explicit external dependencies with FetchContent calls that automatically fetch them from their respective repositories. Thus I deleted: