cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.
MIT License
2.86k stars 182 forks source link

how to pass cmake configure param #530

Open oskycar opened 8 months ago

oskycar commented 8 months ago

option (YAML_CPP_BUILD_TESTS "Build yaml-cpp tests" OFF) option (YAML_CPP_BUILD_TOOLS "Build yaml-cpp tools" OFF) CPMAddPackage("gh:jbeder/yaml-cpp#0.8.0")

I want to import yaml-cpp lib , but don't want to build the test code . but I can't find any way to do this . CPMAddPackage function has any params to config it . and do it as upper code also can't have any effect.

threeal commented 8 months ago

You can use this instead:

CPMAddPackage(
  NAME yaml-cpp
  GITHUB_REPOSITORY jbeder/yaml-cpp
  GIT_TAG 0.8.0
  OPTIONS 
    "YAML_CPP_BUILD_TESTS OFF"
    "YAML_CPP_BUILD_TOOLS OFF"
)
ScottBailey commented 1 month ago

@oskycar I think this demonstrates how to do what you need. Can you close this issue now?