Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
4d96f4cf
Unverified
Commit
4d96f4cf
authored
Jun 16, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔧
overwork CMake files
parent
f4c4bab6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
download_test_data.cmake
cmake/download_test_data.cmake
+1
-2
CMakeLists.txt
test/cmake_fetch_content/project/CMakeLists.txt
+2
-3
No files found.
cmake/download_test_data.cmake
View file @
4d96f4cf
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)
...
@@ -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
...
...
test/cmake_fetch_content/project/CMakeLists.txt
View file @
4d96f4cf
...
@@ -4,9 +4,8 @@ project(DummyImport CXX)
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment