-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
Update documentation to support modern CMake FetchContent
method over ExternalProject.
#698
Comments
Thanks for these instructions! I was missing the scoped include directive. |
FetchContent downloads the project at configure time rather than build time. This should also fix the problem that the initial build of this project always failed on my system. Solution is taken from doctest/doctest#698
I'm trying to get this working, however the test discovery function |
ok, so if you |
slightly better, |
I figured out another way list(APPEND CMAKE_MODULE_PATH "${doctest_SOURCE_DIR}/scripts/cmake")
include(doctest) |
This is how I do it - not sure if it is the best way:
What is the advantage of |
I don't know what the implications of adding |
Description
Hello, thank you for creating or contributing to such a useful and vital tool.
The current build_system documentation describes using the CMake
ExternalProject
mechanism for acquiring the doctest header file and using it in a CMake project.ExternalProject
is great for use with Non-CMake externals, but doctest is a modern CMake package with target support, so users can instead use the more efficient and elegantFetchContent
mechanism.FetchContent supports CMake targets. It also moves the download step to project configure time rather build time like ExternalProject.
I suggest updating the documentation to prefer FetchContent.
For example:
If this is something you're interested in supporting I can open a PR with the above changes.
Steps to reproduce
Extra information
The text was updated successfully, but these errors were encountered: