Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: replace PROJ_TESTS with CTest's BUILD_TESTING option #1870

Merged
merged 1 commit into from Jan 24, 2020

Conversation

mwtoews
Copy link
Member

@mwtoews mwtoews commented Jan 23, 2020

As mentioned in #1263 this PR replaces PROJ_TESTS with CTest's BUILD_TESTING option, which is more generic to CMake projects. CTest (when included) automatically creates a BUILD_TESTING option, with a default ON. Backwards compatibility to the older option PROJ_TESTS is supported, but shows a deprecation message.

For example, a speedy build that does not require tests, configure a build like this:

$ mkdir build && cd build
$ cmake -DBUILD_TESTING=OFF ..
...
$ make -j
...
$ ctest
Test project /path/to/PROJ/build
No tests were found!!!

(as expected)

@kbevers
Copy link
Member

kbevers commented Jan 23, 2020

Looks good @mwtoews !

It would be nice to mention in the docs that you can turn testing off, in the CMake section in https://github.com/OSGeo/PROJ/blob/master/docs/source/install.rst

I take it that we will want to remove the PROJ_TESTS option at some point in the future. It would be good to keep track of things like that somewhere. Perhaps issues set to a 8.0.0 milestone?

* CTest automatically creates a BUILD_TESTING option (default is ON)
* Also allow PROJ_TESTS to be used, but show deprecation message;
  and add note to remove this option by PROJ 8.0
* Only build geodtest when tests are enabled
* Add documentation to configure a build using -DBUILD_TESTING=OFF
@mwtoews
Copy link
Member Author

mwtoews commented Jan 24, 2020

I've updated install.rst, and put a comment to indicate that the old option will be remove by PROJ 8.0, and I'll add a task for that.

@mwtoews mwtoews merged commit e16a24a into OSGeo:master Jan 24, 2020
@kbevers kbevers added this to the 7.0.0 milestone Jan 24, 2020
@mwtoews mwtoews deleted the build-testing branch Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants