spdlog icon indicating copy to clipboard operation
spdlog copied to clipboard

CMake: Build directory `spdlogConfigTargets.cmake` doesn't provide a `spdlog::spdlog_header_only` target

Open robertmaynard opened this issue 2 years ago • 2 comments

The installed version of spdlogConfigTargets.cmake includes both the spdlog::spdlog and spdlog::spdlog_header_only targets. The build directory version only provides the compiled library target, which causes issues for dowstream consumers of the header only version.

This is caused by a mismatch between what targets are exported via the install and export commands. Updating line https://github.com/gabime/spdlog/blob/v1.x/CMakeLists.txt#L339 to also include spdlog_header_only would fix this issue.

robertmaynard avatar Mar 15 '23 14:03 robertmaynard

In addition by not exporting the spdlog_header_only target it means that any downstream user that uses spdlog from source can't export a dependency that has a public dependency on spdlog_header_only

  export called with target "use_spdlog" which requires target "spdlog_header_only"
  that is not in any export set.

robertmaynard avatar Mar 15 '23 14:03 robertmaynard

@robertmaynard Thanks for reporting. PR to fix this would be most welcome.

gabime avatar Mar 18 '23 09:03 gabime

@robertmaynard Any chance you send PR for this before next release (few days)?

gabime avatar Jul 03 '23 13:07 gabime