CPM.cmake icon indicating copy to clipboard operation
CPM.cmake copied to clipboard

package lock with boost

Open jfayot opened this issue 6 months ago • 1 comments

When building target cpm-update-package-lock with boost as dependency like this:

...
CPMAddPackage(
  NAME Boost
  VERSION 1.84.0
  URL https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0.tar.xz
  OPTIONS
    "BOOST_ENABLE_CMAKE ON"
    "BOOST_INCLUDE_LIBRARIES beast\\\;uuid"
)
...

I get the following package lock file:

# CPM Package Lock
# This file should be committed to version control

# Boost
CPMDeclarePackage(Boost
  NAME Boost
  VERSION 1.84.0
  URL
    "https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0.tar.xz"
  OPTIONS
    "BOOST_ENABLE_CMAKE ON"
    "BOOST_INCLUDE_LIBRARIES beast"
    "uuid"
)

Which looks wrong regarding "uuid" component. Indeed, if I try using Boost::uuid in my target_link_libraries, it fails finding uuid whereas Boost::beast is OK.

Moreover, when changing the package lock file to:

# CPM Package Lock
# This file should be committed to version control

# Boost
CPMDeclarePackage(Boost
  NAME Boost
  VERSION 1.84.0
  URL
    "https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0.tar.xz"
  OPTIONS
    "BOOST_ENABLE_CMAKE ON"
    "BOOST_INCLUDE_LIBRARIES beast\\\;uuid"
)

I still get the error finding Boost::uuid while if not making use of package lock file, all is fine...

Thanks for your help

jfayot avatar Aug 12 '24 11:08 jfayot