Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
d39842e6
Unverified
Commit
d39842e6
authored
Mar 13, 2019
by
Niels Lohmann
Committed by
GitHub
Mar 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1330 from ax3l/topic-installEmbed
CMake: Optional Install if Embedded
parents
670f42b5
f049836d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
27 deletions
+34
-27
CMakeLists.txt
CMakeLists.txt
+30
-27
README.md
README.md
+4
-0
No files found.
CMakeLists.txt
View file @
d39842e6
...
...
@@ -16,6 +16,7 @@ include(ExternalProject)
## OPTIONS
##
option
(
JSON_BuildTests
"Build the unit tests when BUILD_TESTING is enabled."
ON
)
option
(
JSON_Install
"Install CMake targets during install step."
ON
)
option
(
JSON_MultipleHeaders
"Use non-amalgamated version of the library."
OFF
)
##
...
...
@@ -96,32 +97,34 @@ configure_file(
@ONLY
)
install
(
DIRECTORY
${
NLOHMANN_JSON_INCLUDE_BUILD_DIR
}
DESTINATION
${
NLOHMANN_JSON_INCLUDE_INSTALL_DIR
}
)
install
(
FILES
${
NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE
}
${
NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE
}
DESTINATION
${
NLOHMANN_JSON_CONFIG_INSTALL_DIR
}
)
if
(
NLOHMANN_ADD_NATVIS
)
if
(
JSON_Install
)
install
(
FILES
${
NLOHMANN_NATVIS_FILE
}
DESTINATION .
)
DIRECTORY
${
NLOHMANN_JSON_INCLUDE_BUILD_DIR
}
DESTINATION
${
NLOHMANN_JSON_INCLUDE_INSTALL_DIR
}
)
install
(
FILES
${
NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE
}
${
NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE
}
DESTINATION
${
NLOHMANN_JSON_CONFIG_INSTALL_DIR
}
)
if
(
NLOHMANN_ADD_NATVIS
)
install
(
FILES
${
NLOHMANN_NATVIS_FILE
}
DESTINATION .
)
endif
()
export
(
TARGETS
${
NLOHMANN_JSON_TARGET_NAME
}
NAMESPACE
${
PROJECT_NAME
}
::
FILE
${
NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE
}
)
install
(
TARGETS
${
NLOHMANN_JSON_TARGET_NAME
}
EXPORT
${
NLOHMANN_JSON_TARGETS_EXPORT_NAME
}
INCLUDES DESTINATION
${
NLOHMANN_JSON_INCLUDE_INSTALL_DIR
}
)
install
(
EXPORT
${
NLOHMANN_JSON_TARGETS_EXPORT_NAME
}
NAMESPACE
${
PROJECT_NAME
}
::
DESTINATION
${
NLOHMANN_JSON_CONFIG_INSTALL_DIR
}
)
endif
()
export
(
TARGETS
${
NLOHMANN_JSON_TARGET_NAME
}
NAMESPACE
${
PROJECT_NAME
}
::
FILE
${
NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE
}
)
install
(
TARGETS
${
NLOHMANN_JSON_TARGET_NAME
}
EXPORT
${
NLOHMANN_JSON_TARGETS_EXPORT_NAME
}
INCLUDES DESTINATION
${
NLOHMANN_JSON_INCLUDE_INSTALL_DIR
}
)
install
(
EXPORT
${
NLOHMANN_JSON_TARGETS_EXPORT_NAME
}
NAMESPACE
${
PROJECT_NAME
}
::
DESTINATION
${
NLOHMANN_JSON_CONFIG_INSTALL_DIR
}
)
README.md
View file @
d39842e6
...
...
@@ -100,6 +100,10 @@ To embed the library directly into an existing CMake project, place the entire s
# run from your own project's code.
set
(
JSON_BuildTests OFF CACHE INTERNAL
""
)
# If you only include this third party in PRIVATE source files, you do not
# need to install it when your main project gets installed.
# set(JSON_Install OFF CACHE INTERNAL "")
# Don't use include(nlohmann_json/CMakeLists.txt) since that carries with it
# unintended consequences that will break the build. It's generally
# discouraged (although not necessarily well documented as such) to use
...
...
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