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

Not installable when used as subdirectory #91

Closed
SoilRos opened this issue Feb 5, 2021 · 3 comments
Closed

Not installable when used as subdirectory #91

SoilRos opened this issue Feb 5, 2021 · 3 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Milestone

Comments

@SoilRos
Copy link
Contributor

SoilRos commented Feb 5, 2021

Describe the bug
When I use the library as a cmake subdirectory, the targets and files do not get installed even if I need them to be installed. The following line cannot be bypassed and GHC_FILESYSTEM_WITH_INSTALL cannot be set

cmake_dependent_option(GHC_FILESYSTEM_WITH_INSTALL

This was introduced on jpd002/Play-#825 because the final application did not need the headers (i.e. consumption is PRIVATE), but that's not the case in general (i.e. consumption is PUBLIC). Development libraries, may need to provide these headers as well.

To Reproduce
Here is the situation: I have a target target_a that depends on target_b (i.e ghc_filesystem).

target_link_libraries(target_a PUBLIC target_b)

The problem comes when I want to install and export my target target_a.

install(TARGETS target_a EXPORT target_a_targets ...)
install(EXPORT target_a_targets ...)

If target_b is not installed as well, then CMake complains that it will not be able to find such target again when reading the configure script for my project. Which is true, after all, target_b is not installed. In such case, the target_b happens to be relatively useless (in the Modern CMake usage) and one has to manually add complier flags, include directories, etc.

Expected behavior
The GHC_FILESYSTEM_WITH_INSTALL option can be set when using the library as a subdirectory.

@gulrak gulrak added the bug Something isn't working label Feb 5, 2021
@gulrak gulrak self-assigned this Feb 5, 2021
@gulrak gulrak added this to the v1.5.0 milestone Feb 5, 2021
@gulrak
Copy link
Owner

gulrak commented Feb 5, 2021

Thanks for reporting it, true, that should work. I'll look into it, probably during the weekend.

gulrak added a commit that referenced this issue Feb 7, 2021
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Feb 7, 2021
@gulrak
Copy link
Owner

gulrak commented Feb 7, 2021

This is now part of release v1.5.0

@gulrak gulrak closed this as completed Feb 7, 2021
@SoilRos
Copy link
Contributor Author

SoilRos commented Feb 8, 2021

Great! Thank you! That now works for me.

If you could add an alias so that one can use it as if it was imported, it would be 🔝 (I just realised that you cannot create aliases on parent directories)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants