-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Allow setting JSON_BuildTests=OFF from parent CMakeLists.txt #846
Comments
What do you propose? Replacing |
I want to disable building tests in my project's CMakeLists.txt. I have a
|
OK. I'm not a CMake expert. Could you describe what needs to be done or open a PR? |
@nlohmann Sorry I just notice you are not using CTest. So BUILD_TESTING is not an option here. I'll pass -DBuildTests=OFF in a script instead of specify it in my CMakeLists.txt as a workaround. This issue should be closed. |
In fact we are using ctest... |
I've seen quite a few cmake projects using IIUC, we're not including the CTest module, so the |
Any ideas on this? |
I am not really sure, what the original issue is.
Yes, regarding to the CTest doc, BUILD_TESTING is included when you include the CTest module via cmake (not done by the project atm). The I would propose:
This approach allows disabling all tests (of all parent/subprojects) with The problem would be in the existence of a single inconsistency: The default value of ATM, I see no good approach that keeps backward compatibility and/or consistency of the 2 variables, when they get replaced and/or depends on each other. Corresponding pull request: #885 |
Closed by merging #885. |
I think a standard BUILD_TESTING option is better in this case?
Meanwhile, setting JSON_BuildTests=ON prevents the user from disabling the unit test build from parent CMakeLists.txt.
The text was updated successfully, but these errors were encountered: