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 1
1
set (JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
2
2
set (JSON_TEST_DATA_VERSION 3.1.0)
3
3
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 ()
5
9
6
10
# if variable is set, use test data from given directory rather than downloading them
7
11
if (JSON_TestDataDirectory)
8
12
message (STATUS "Using test data in ${JSON_TestDataDirectory} ." )
9
13
add_custom_target (download_test_data)
10
14
file (WRITE ${CMAKE_BINARY_DIR} /include /test_data.hpp "#define TEST_DATA_DIRECTORY \" ${JSON_TestDataDirectory} \"\n " )
11
15
else ()
16
+ include (ExternalProject)
12
17
# create a header with the path to the downloaded test data
13
18
file (WRITE ${CMAKE_BINARY_DIR} /include /test_data.hpp "#define TEST_DATA_DIRECTORY \" ${CMAKE_BINARY_DIR} /test_files\"\n " )
14
19
Original file line number Diff line number Diff line change @@ -192,6 +192,9 @@ if (JSON_Install)
192
192
endif ()
193
193
194
194
add_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
+
197
200
add_subdirectory (cmake_target_include_directories)
You can’t perform that action at this time.
0 commit comments