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

Exported CMake config should use thirdparty lib targets and preferably find them on its own #64

Open
jpfeuffer opened this issue May 23, 2023 · 1 comment

Comments

@jpfeuffer
Copy link

jpfeuffer commented May 23, 2023

if(CMAKE_CONFIGURATION_TYPES)
  set_property(TARGET Boost::iostreams APPEND PROPERTY INTERFACE_LINK_LIBRARIES
    "$<$<CONFIG:release>:bz2;lzma;z;zstd>")
else()
  set_property(TARGET Boost::iostreams APPEND PROPERTY INTERFACE_LINK_LIBRARIES
    bz2 lzma z zstd)
endif()

This is not going to work if I just link to Boost::iostreams. How should a consumer know that those libraries are needed?
If I am not mistaken, In modern CMake you would call find_dependencies(ZSTD::ZSTD $Version) and then link to the imported target in your exported CMake file.

This gets especially tricky with boost::regex and ICU, where I don't even know which version I should find in my own CMake script that is "finding" boost.

@jpfeuffer jpfeuffer changed the title Exported CMake config should use targets and preferably find them on its own Exported CMake config should use thirdparty lib targets and preferably find them on its own May 23, 2023
@jpfeuffer
Copy link
Author

Using boost 1.81 from brew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant