Hi,
I have a project which uses the Boost library through the target Boost::headers . I really like the idea of CPS and I would like to use it to install the project. But I encountered a configuration error:
CMake Error in src/CMakeLists.txt:
Target "mps" references target "Boost::headers", which comes from the
"boost_headers" package, but does not belong to the package's canonical
namespace ("boost_headers::"). This is not allowed.
I knew from the post that CPS enforce the package name must be exactly the same as namespace. But widely used C++ libraries like Boost don’t follow this rule and this makes the adoption of CPS extremely difficult.
Is there any way to go around this error, without giving up on CPS or Boost::headers?
Thanks very much
Versions
CMake version: 4.3.0
Boost version: 1.90
Code
find_package(Boost REQUIRED CONFIG)
# ...
target_link_libraries(mps PUBLIC Boost::headers)
install(TARGETS mps EXPORT mps FILE_SET publicHeaders)
install(PACKAGE_INFO mps EXPORT mps VERSION 1.0.0)