Not installable when used as subdirectory
SoilRos opened this issue · comments
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
Line 17 in de57485
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.
Thanks for reporting it, true, that should work. I'll look into it, probably during the weekend.
This is now part of release v1.5.0
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)