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

Install headers in a subdirectory #110

Merged
merged 2 commits into from
Dec 9, 2023
Merged

Conversation

bkmgit
Copy link
Contributor

@bkmgit bkmgit commented Dec 7, 2023

Solves #108

@dougbinks
Copy link
Owner

Many thanks for the issue #108 and this PR.

Since I do not install libraries (I believe all dependencies should be in your code repo or subrepos) and did not write the install, I'll ask @pr0g who made the last major change to the cmake install #96 to review this, especially as their change was the one to remove the enkiTS include subfolder.

If this PR doesn't break the use of cmake install then I'm happy to merge it.

@bkmgit
Copy link
Contributor Author

bkmgit commented Dec 7, 2023

Trying to package this for Fedora Linux. Likelihood of name collisions with headers of other software ar reduced if headers are in a subdirectory.

@pr0g
Copy link
Contributor

pr0g commented Dec 7, 2023

Hey there,

I took a look at this and it totally makes sense, but I think it would technically constitute a breaking change (if anyone was depending on how the library is installed right now). So maybe a version bump if that's possible would be a good idea?

I intentionally didn't add the library name folder to keep things the same as when including files via FetchContent, as the folder name isn't there in that case. With this change I believe the include paths would be different if using FetchContent of find_package via installing. It's not a huge deal but probably worth mentioning somewhere in the docs too for usage (when I install I usually use a local folder via CMAKE_INSTALL_PREFIX so hadn't run into this issue before).

So this can be merged but I'd recommend maybe a small doc update if possible and a version bump to indicate the change. Maybe that's overkill, but just a suggestion. This is up to @dougbinks.

Thanks!

@pr0g
Copy link
Contributor

pr0g commented Dec 7, 2023

Actually one other option might also be to modify:

enkiTS/CMakeLists.txt

Lines 48 to 50 in 8c13c08

target_include_directories( enkiTS PUBLIC
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )

So it looks like this...

target_include_directories( enkiTS PUBLIC 
     PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src> 
            $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/enkiTS>) 

That way the include paths would remain the same, and you'd avoid any potential collisions if installing to the system.

@bkmgit
Copy link
Contributor Author

bkmgit commented Dec 8, 2023

Version bump is a good idea. For documentation, do you have suggestions? Can make a separate pull request as it may also be helpful to add information on using the shared library.

@pr0g
Copy link
Contributor

pr0g commented Dec 8, 2023

Updates look great thanks @bkmgit 👍 For the docs I reckon the Building section of the README is as good a place as any. If it isn't too much trouble it would also be great to check this repo works with your changes (I believe it should) - https://github.com/pr0g/enkiTS-example. You just need to update the CMakeLists.txt file in the third-party folder to your repo (see here). Cheers!

@dougbinks
Copy link
Owner

dougbinks commented Dec 8, 2023

Thanks for this work both of you!

I'm happy to merge this without the documentation, and have the documentation added in another PR. I'll perform a few more checks and merge shortly.

I intend to tag a new version soon once this is done.

@pr0g
Copy link
Contributor

pr0g commented Dec 8, 2023

Sounds great @dougbinks 🙌 Thanks!

@bkmgit
Copy link
Contributor Author

bkmgit commented Dec 9, 2023 via email

@dougbinks
Copy link
Owner

Please take your time, there's no rush and I'll wait for your PR before making a new release.

I may merge this PR to the dev branch in the meantime.

@dougbinks dougbinks changed the base branch from master to dev December 9, 2023 15:41
@dougbinks dougbinks merged commit c3a4542 into dougbinks:dev Dec 9, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants