Skip to content

passing -Dxxx to the cmake config of a package #232

Answered by JohelEGP
grbba asked this question in Q&A
Discussion options

You must be logged in to vote

I think what you're looking for is OPTIONS, see the README.

CPM.cmake/README.md

Lines 34 to 42 in 8e8dcc9

```cmake
CPMAddPackage(
NAME # The unique name of the dependency (should be the exported target's name)
VERSION # The minimum version of the dependency (optional, defaults to 0)
OPTIONS # Configuration options passed to the dependency (optional)
DOWNLOAD_ONLY # If set, the project is downloaded, but not configured (optional)
[...] # Origin parameters forwarded to FetchContent_Declare, see below
)
```

Check out the README and wiki for examples.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by grbba
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants