cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Package Lock Formatting After Second Update

threeal opened this issue · comments

I'm using the latest version of CPM.cmake (v0.38.5).

When I add a package with OPTIONS specified to my project and run the cpm-update-package-lock target, it initially generates the package lock like this:

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

# yaml-cpp
CPMDeclarePackage(yaml-cpp
  GIT_TAG 0.8.0
  GITHUB_REPOSITORY jbeder/yaml-cpp
  SYSTEM YES
  OPTIONS
    "YAML_CPP_FORMAT_SOURCE OFF"
  EXCLUDE_FROM_ALL YES
)

However, upon running the cpm-update-package-lock target for the second time, it updates the package lock incorrectly, resulting in this formatting:

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

# yaml-cpp
CPMDeclarePackage(yaml-cpp
  GIT_TAG 0.8.0
  GITHUB_REPOSITORY jbeder/yaml-cpp
  SYSTEM YES
  OPTIONS
    "YAML_CPP_FORMAT_SOURCE OFF"
    "EXCLUDE_FROM_ALL"
    "YES"
)

You can see that the EXCLUDE_FROM_ALL option is now mistakenly combined with the other options. This behavior seems to be due to the interpretation of EXCLUDE_FROM_ALL as part of the OPTIONS.