File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11set (JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
22set (JSON_TEST_DATA_VERSION 3.1.0)
33
4- include (ExternalProject)
4+ set (JSON_TEST_DATA_DIR /usr/share/json_test_data-${JSON_TEST_DATA_VERSION} )
5+
6+ if (EXISTS ${JSON_TEST_DATA_DIR} )
7+ set (JSON_TestDataDirectory ${JSON_TEST_DATA_DIR} )
8+ endif ()
59
610# if variable is set, use test data from given directory rather than downloading them
711if (JSON_TestDataDirectory)
812 message (STATUS "Using test data in ${JSON_TestDataDirectory} ." )
913 add_custom_target (download_test_data)
1014 file (WRITE ${CMAKE_BINARY_DIR} /include /test_data.hpp "#define TEST_DATA_DIRECTORY \" ${JSON_TestDataDirectory} \"\n " )
1115else ()
16+ include (ExternalProject)
1217 # create a header with the path to the downloaded test data
1318 file (WRITE ${CMAKE_BINARY_DIR} /include /test_data.hpp "#define TEST_DATA_DIRECTORY \" ${CMAKE_BINARY_DIR} /test_files\"\n " )
1419
Original file line number Diff line number Diff line change @@ -192,6 +192,9 @@ if (JSON_Install)
192192endif ()
193193
194194add_subdirectory (cmake_add_subdirectory)
195- add_subdirectory (cmake_fetch_content)
196- add_subdirectory (cmake_fetch_content2)
195+ if (NOT JSON_No_Internet)
196+ add_subdirectory (cmake_fetch_content)
197+ add_subdirectory (cmake_fetch_content2)
198+ endif ()
199+
197200add_subdirectory (cmake_target_include_directories)
You can’t perform that action at this time.
0 commit comments