Skip to content

dependencies fix, check for GLM with pkg-config first#4

Open
bartman wants to merge 1 commit intoTheCherno:mainfrom
bartman:fix-dependencies
Open

dependencies fix, check for GLM with pkg-config first#4
bartman wants to merge 1 commit intoTheCherno:mainfrom
bartman:fix-dependencies

Conversation

@bartman
Copy link
Copy Markdown

@bartman bartman commented Sep 24, 2025

On my system, Linux (NixOS), Cmake was unable to find GLM, which is accessible via GLM.
However, pkg-config works.

The patch provided, will try to use pkg-config, then find_package, before falling back to fetchcontent.

Hope that's acceptable.

@sudopluto
Copy link
Copy Markdown

sudopluto commented Oct 9, 2025

you might want to just use the fetchcontent example in the glm readme:

https://github.com/g-truc/glm/blob/master/readme.md#cmake-using-fetchcontent

cmake_minimum_required(VERSION 3.11) # FetchContent is new in version 3.11.

include(FetchContent)

FetchContent_Declare(
	glm
	GIT_REPOSITORY	https://github.com/g-truc/glm.git
	GIT_TAG 	0af55ccecd98d4e5a8d1fad7de25ba429d60e863 #refs/tags/1.0.1
)

FetchContent_MakeAvailable(glm)

target_link_libraries(main PRIVATE glm::glm)

here is another ref from documentation:
https://github.com/g-truc/glm/blob/master/manual.md#-15-finding-glm-with-cmake

at least the way it seems, the only thing we want vendored by the OS is opengl (even that gets complicated on linux with glvnd & hybrid graphics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants