1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-03 22:13:51 +00:00

fix: error in documentation for FetchContent (#969)

The current installation documentation for FetchContent with CMake,
result in the following error Error:

```
CMake Error at /opt/homebrew/Cellar/cmake/3.28.1/share/cmake/Modules/FetchContent.cmake:1221 (message):
  No content details recorded for cli11
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.1/share/cmake/Modules/FetchContent.cmake:1740 (__FetchContent_getSavedDetails)
  /opt/homebrew/Cellar/cmake/3.28.1/share/cmake/Modules/FetchContent.cmake:2033 (FetchContent_Populate)
  CMakeLists.txt:17 (FetchContent_MakeAvailable)
```

The important part: `  No content details recorded for cli11`.

I have changed the documentation such that the part which covers
FetchContent works out of the box.
This commit is contained in:
Lars Nielsen 2024-01-01 17:47:41 +01:00 committed by GitHub
parent dc137f0c16
commit dfc9e25f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,19 +97,17 @@ An example CMake file would include:
```cmake ```cmake
include(FetchContent) include(FetchContent)
FetchContent_Populate( FetchContent_Declare(
cli11_proj cli11_proj
QUIET QUIET
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v2.3.2 GIT_TAG v2.3.2
SOURCE_DIR cli11_proj
) )
FetchContent_MakeAvailable(cli11) FetchContent_MakeAvailable(cli11_proj)
# And now you can use it # And now you can use it
add_subdirectory(${cli11_proj_SOURCE_DIR} ${cli11_proj_SOURCE_DIR}/build) target_link_libraries(<your project> PRIVATE CLI11::CLI11)
target_link_libraries(<your project> CLI11::CLI11)
``` ```
And use And use