json.cmake 550 B

1234567891011121314151617181920212223242526
  1. # Build Json
  2. # The GitHub release (tag) we want to use
  3. SET(JSON_TAG v3.9.1)
  4. SET(JSON_PREFIX nlohmann_json)
  5. SET(JSON_URL https://github.com/nlohmann/json)
  6. # Configure Json
  7. SET(JSON_BuildTests OFF CACHE INTERNAL "")
  8. # Add Json
  9. FETCHCONTENT_DECLARE(
  10. ${JSON_PREFIX}
  11. PREFIX ${JSON_PREFIX}
  12. GIT_REPOSITORY ${JSON_URL}
  13. GIT_TAG ${JSON_TAG}
  14. )
  15. FETCHCONTENT_GETPROPERTIES(${JSON_PREFIX})
  16. IF(NOT ${JSON_PREFIX}_POPULATED)
  17. FETCHCONTENT_POPULATE(${JSON_PREFIX})
  18. ADD_SUBDIRECTORY(${${JSON_PREFIX}_SOURCE_DIR} ${${JSON_PREFIX}_BINARY_DIR})
  19. ENDIF()