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

Missing cmake documentation #70

Open
elpie89 opened this issue Jan 10, 2021 · 2 comments
Open

Missing cmake documentation #70

elpie89 opened this issue Jan 10, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@elpie89
Copy link

elpie89 commented Jan 10, 2021

I'm trying to build a project that use some library like glm, QT, Vulkan etc.
Of course, I'm trying to use glTF-SDK too.
I'm struggling a lot because there is no documentation on how to use CMake with glTF-SDK
To be more specific CMake through the use of the FetchContent command can act as a package manager.
So I'm trying to use it in that way avoiding to use NuGet or vckpg
Can someone add an example on how to use this library from CMake in a proper way?

@bghgary
Copy link
Contributor

bghgary commented Jan 11, 2021

I'm not familiar with FetchContent usage and I don't know anyone who has tried it with this repo, but this seems like a cmake question and not something specific to this repo. If you bring the repo as a cmake dependency (e.g. via add_subdirectory), you should be able to include the GLTFSDK target. Would that work for you?

@santipaprika
Copy link

santipaprika commented Feb 27, 2023

This worked for me:

# Declare the repo
include(FetchContent)
FetchContent_Declare(
  glTF-SDK
  GIT_REPOSITORY https://github.com/microsoft/glTF-SDK.git
  GIT_TAG        382dea2c80737f9f3ae2b93e97263a593c2ea832 # r1.9.6.0
)

# Populate the library
FetchContent_MakeAvailable(glTF-SDK)

# Link to your target
target_link_libraries(MyTarget GLTFSDK)

@bghgary bghgary added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers triaged labels Dec 7, 2023
@thomlucc thomlucc removed the triaged label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants