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

how to pass cmake configure param

Open oskycar opened this issue 1 year ago • 2 comments

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.

oskycar avatar Jan 02 '24 04:01 oskycar

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"
)

threeal avatar Jan 10 '24 05:01 threeal

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

ScottBailey avatar Aug 03 '24 14:08 ScottBailey