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

Including in another CMake build system project via ExternalProject #24

Open
whatnick opened this issue Mar 7, 2021 · 3 comments
Open

Comments

@whatnick
Copy link

whatnick commented Mar 7, 2021

I am planning to include fast_obj in another Mesh data translator library (i3s-lib)as an example of mesh-format with LoD packed as a single file via CMake ExternalProject mechanism. Placing the header in the executable source's include path via this mechanism should work.

Has this been done previously for other projects ? Are there samples around ?

Please see : Esri/i3s-lib#6

@thisistherk
Copy link
Owner

Not something I've ever used, don't see why it wouldn't work though. I tend to just drop the header in whatever I'm using then check it in with the rest of the source rather than keep it separate. The fast_obj CMake file is just for building the test app so won't be much use to you - don't know if that makes it more difficult.

@whatnick
Copy link
Author

whatnick commented Mar 7, 2021

I have CMake automatically cloning this repo. Will look at adding the path to the header in the spot the cloned stuff sits in build directory and we should be good.

@deccer
Copy link

deccer commented Sep 26, 2024

I use FetchContent like so

FetchContent_Declare(
    fast_obj
    GIT_REPOSITORY https://github.com/thisistherk/fast_obj.git
    GIT_TAG        master
    GIT_SHALLOW    TRUE
    GIT_PROGRESS   TRUE
)
FetchContent_MakeAvailable(fast_obj)
# in my project
target_link_libraries(MyProject
...
    PRIVATE fast_obj
...
)

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

No branches or pull requests

3 participants