forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build release tarball when nlohmann-json not installed (open-telemetr…
- Loading branch information
Showing
6 changed files
with
77 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
if("${nlohmann-json}" STREQUAL "") | ||
set(nlohmann-json "develop") | ||
endif() | ||
include(ExternalProject) | ||
ExternalProject_Add(nlohmann_json_download | ||
PREFIX third_party | ||
GIT_REPOSITORY https://github.com/nlohmann/json.git | ||
GIT_TAG | ||
"${nlohmann-json}" | ||
UPDATE_COMMAND "" | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} | ||
-DJSON_BuildTests=OFF | ||
-DJSON_Install=ON | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
TEST_AFTER_INSTALL | ||
0 | ||
DOWNLOAD_NO_PROGRESS | ||
1 | ||
LOG_CONFIGURE | ||
1 | ||
LOG_BUILD | ||
1 | ||
LOG_INSTALL | ||
1 | ||
) | ||
|
||
ExternalProject_Get_Property(nlohmann_json_download INSTALL_DIR) | ||
SET(NLOHMANN_JSON_INCLUDE_DIR ${INSTALL_DIR}/third_party/src/nlohmann_json_download/single_include) | ||
add_library(nlohmann_json_ INTERFACE) | ||
target_include_directories(nlohmann_json_ INTERFACE | ||
"$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_DIR}>" | ||
"$<INSTALL_INTERFACE:include>") | ||
add_dependencies(nlohmann_json_ nlohmann_json_download) | ||
add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json_) | ||
|
||
install( | ||
TARGETS nlohmann_json_ | ||
EXPORT "${PROJECT_NAME}-target" | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters