[cmake-developers] PLplot contract test

Brad King brad.king at kitware.com
Wed Nov 8 06:54:21 EST 2017


On 11/07/2017 03:50 PM, Alan W. Irwin wrote:
>> # Do build of PLplot as a ctest of CMake.
>> set(CMake_TEST_CONTRACT_PLplot:BOOL=ON)
>
> Why could I set garbage in the cache
> file as above with the result that that garbage was read
> and ignored with no error message?  Isn't that a CMake bug?

The `#` is a comment whiel the `//` is documentation.
The format of the cache entries themselves is *very* tolerant.
Your line set a variable called "set(CMake_TEST_CONTRACT_PLplot"
to the value "ON)".

> CMake_TEST_CONTRACT_PLplot_CMAKE_ARGS:STRING=-DBUILD_TEST=ON -DBUILD_DOC=ON -DBUILD_DOX_DOC=ON

I've updated the test.  Change the name from _ARGS to _FLAGS:

```
CMake_TEST_CONTRACT_PLplot_CMAKE_FLAGS:STRING=-DBUILD_TEST=ON -DBUILD_DOC=ON -DBUILD_DOX_DOC=ON
```

> Finally, how can I change the default tag currently used
> ("plplot-5.13.0") for checking out PLplot?

I've added an option:

```
CMake_TEST_CONTRACT_PLplot_GIT_TAG:STRING=plplot-5.12.0
```

The value can be anything that `git checkout` understands
(tag, branch, commit sha1, etc.).

-Brad


More information about the cmake-developers mailing list