1. 29 Apr, 2020 1 commit
    • ArthurSonzogni's avatar
      Add CMake fetchcontent documentation and tests · c3317066
      ArthurSonzogni authored
      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.
      c3317066
  2. 28 Apr, 2020 1 commit
  3. 27 Apr, 2020 1 commit
  4. 24 Apr, 2020 1 commit
  5. 23 Apr, 2020 1 commit
  6. 21 Apr, 2020 1 commit
  7. 20 Apr, 2020 6 commits
  8. 19 Apr, 2020 4 commits
  9. 17 Apr, 2020 3 commits
  10. 16 Apr, 2020 1 commit
  11. 14 Apr, 2020 1 commit
  12. 13 Apr, 2020 5 commits
  13. 12 Apr, 2020 3 commits
  14. 11 Apr, 2020 4 commits
  15. 10 Apr, 2020 4 commits
  16. 08 Apr, 2020 1 commit
  17. 07 Apr, 2020 2 commits