Skip to content

Not installable when used as subdirectory #91

@SoilRos

Description

@SoilRos

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.

Metadata

Metadata

Assignees

Labels

available on masterFix is done on master branch, issue closed on next releasebugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions