ned14 / status-code

Proposed SG14 status_code for the C++ standard
Other
64 stars 13 forks source link

buildsystem: include directories vs target sources #43

Closed BurningEnlightenment closed 2 years ago

BurningEnlightenment commented 2 years ago

The vcpkg port moves all headers into a status-code subdirectory: file(RENAME "${CURRENT_PACKAGES_DIR}/include2" "${CURRENT_PACKAGES_DIR}/include/status-code") https://github.com/microsoft/vcpkg/blob/eddbb406cff0ff7828592d5a92e64abb59808534/ports/status-code/portfile.cmake#L25-L26

This, however, is incompatible with the install interface target sources which expect the headers to directly reside in the include directory: https://github.com/ned14/status-code/blob/42d3afaa388ae966938f558d9e00e390a2192fa8/CMakeLists.txt#L109-L111

Additionally I find install interface target sources to be annoying, because e.g. the cmake VS solution generator adds them to all (transitively) depending targets. What was the rationale for referencing all headers from the installed target? Can we do without?

ned14 commented 2 years ago

Am I being dumb here or isn't the right fix just to fix how cmake does the install so it's right, and then the vcpkg port doesn't need to rename anything?

BurningEnlightenment commented 2 years ago

Yes, probably. Is it intended to look like #include <status-code/status_code.hpp> or #include <status_code.hpp>?

Anyway, can we do without the target sources for installed targets? My issue looks like this: grafik

I'd make a PR.

ned14 commented 2 years ago

Note that we can't update Outcome to match this until after the pending Boost release.