Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add the glm interface library in cmake #963

Merged
merged 3 commits into from
Nov 2, 2019
Merged

Conversation

kiroma
Copy link

@kiroma kiroma commented Oct 15, 2019

Also re-work the main cmakelists to make the project more easily embeddable

Also re-work the main cmakelists to make the project more easily embeddable
@Groovounet
Copy link
Member

I am not getting the purpose of these changes... GLM doesn't need to be linked to be used.

What these interfaces library does?

@kiroma
Copy link
Author

kiroma commented Oct 19, 2019

add_library(dummy INTERFACE)
target_include_directories(dummy INTERFACE my_include_dir)
add_executable(my_executable main.cpp)
target_link_libraries(my_executable dummy)

The INTERFACE keyword in target_include_directories means that when another target links against dummy, it must also have the includes specified for dummy, therefore it's about an equivalent of saying target_include_directories(my_executable PRIVATE my_include_dir)

In add_library it means that the target does not have any output.

This way the library author can specify which directories should be included by the user, while the user simply has to link against a dummy target which sets everything up.
include_directories is problematic as it gets completely omitted when the project is added via add_subdirectory.

@fuzzyTew
Copy link

@kiroma it doesn't look like people are successfully able to use this (see linked issue). Are you able to give a quick description of how embedding is expected to work now?

@kiroma
Copy link
Author

kiroma commented Jan 30, 2021

Oh god I have not looked at this in forever. I thought someone else would pick it up.
A FindGLM.cmake module has to be written. I'll take a look and see what I can come up with.

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.

None yet

3 participants