🔧 overwork CMake files
This commit is contained in:
parent
f4c4bab600
commit
4d96f4cf6a
2 changed files with 3 additions and 5 deletions
|
@ -1,5 +1,3 @@
|
||||||
find_package(Git)
|
|
||||||
|
|
||||||
set(JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
|
set(JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
|
||||||
set(JSON_TEST_DATA_VERSION 2.0.0)
|
set(JSON_TEST_DATA_VERSION 2.0.0)
|
||||||
|
|
||||||
|
@ -9,6 +7,7 @@ if(JSON_TestDataDirectory)
|
||||||
add_custom_target(download_test_data)
|
add_custom_target(download_test_data)
|
||||||
file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${JSON_TestDataDirectory}\"\n")
|
file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${JSON_TestDataDirectory}\"\n")
|
||||||
else()
|
else()
|
||||||
|
find_package(Git)
|
||||||
# target to download test data
|
# target to download test data
|
||||||
add_custom_target(download_test_data
|
add_custom_target(download_test_data
|
||||||
COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone -c advice.detachedHead=false --branch v${JSON_TEST_DATA_VERSION} ${JSON_TEST_DATA_URL}.git --quiet --depth 1
|
COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone -c advice.detachedHead=false --branch v${JSON_TEST_DATA_VERSION} ${JSON_TEST_DATA_URL}.git --quiet --depth 1
|
||||||
|
|
|
@ -4,9 +4,8 @@ project(DummyImport CXX)
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
FetchContent_Declare(json
|
get_filename_component(GIT_REPOSITORY_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. ABSOLUTE)
|
||||||
GIT_REPOSITORY ${CMAKE_CURRENT_SOURCE_DIR}/../../..
|
FetchContent_Declare(json GIT_REPOSITORY ${GIT_REPOSITORY_DIRECTORY} GIT_TAG HEAD)
|
||||||
GIT_TAG HEAD)
|
|
||||||
|
|
||||||
FetchContent_GetProperties(json)
|
FetchContent_GetProperties(json)
|
||||||
if(NOT json_POPULATED)
|
if(NOT json_POPULATED)
|
||||||
|
|
Loading…
Reference in a new issue