json/test
ArthurSonzogni c331706644 Add CMake fetchcontent documentation and tests
Github issue:
https://github.com/nlohmann/json/issues/2073

nlohmann::json documents 2 way of depending on it using CMake
1) Copy-paste the project/source into your own project.
2) Install nlohman::json and then use find_package.

(1) pollutes your git repository, (2) requires everyone to install the
dependencies themselves.

Since 2018, CMake provide some kind of 'package manager' features using
[FetchContent](https://cmake.org/cmake/help/v3.17/module/FetchContent.html)
It gives the following:
~~~cmake
include(FetchContent)

FetchContent_Declare(json
  GIT_REPOSITORY https://github.com/nlohmann/json
  GIT_TAG v3.7.3)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
  FetchContent_Populate(json)
  add_subdirectory( ${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
~~~

Then declares the dependency in the target using it:
~~~cmake
target_link_library(my_project PRIVATE nlohmann_json::nlohmann_json
~~~

This patch updates the documentation and provides tests.
2020-04-29 18:28:06 +02:00
..
cmake_add_subdirectory Update tests that generate CMake projects to use the CMAKE_CXX_COMPILER the main project was CMake'd with. Fixes #1747. 2019-11-18 21:46:34 -06:00
cmake_fetch_content Add CMake fetchcontent documentation and tests 2020-04-29 18:28:06 +02:00
cmake_import Update tests that generate CMake projects to use the CMAKE_CXX_COMPILER the main project was CMake'd with. Fixes #1747. 2019-11-18 21:46:34 -06:00
cmake_import_minver Update tests that generate CMake projects to use the CMAKE_CXX_COMPILER the main project was CMake'd with. Fixes #1747. 2019-11-18 21:46:34 -06:00
data Add binary type support to all binary file formats, as well as an internally represented binary type 2020-04-14 10:22:45 -04:00
reports added fuzzing results 2016-10-02 11:23:47 +02:00
src 🐛 fix returning reference to local temporary object #2064 2020-04-27 14:43:49 +02:00
thirdparty ⬆️ doctest 2.3.7 #2048 2020-04-19 12:33:42 +02:00
CMakeLists.txt Add CMake fetchcontent documentation and tests 2020-04-29 18:28:06 +02:00
Makefile move newly-added tests in unit-regression.cpp 2019-01-19 11:36:50 -05:00