-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JMT] Add cmake files for nlohmann json
- Loading branch information
Juan Manzanero
committed
Jul 23, 2024
1 parent
d968749
commit ec1c96b
Showing
6 changed files
with
59 additions
and
9 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,16 @@ | ||
if (NOT nlohmann_json_FOUND) | ||
find_path(NLOHMANNJSON_INCLUDE_DIR nlohmann/json.hpp PATHS ${CMAKE_BINARY_DIR}/lion/thirdparty/include NO_DEFAULT_PATH) | ||
|
||
if (NLOHMANNJSON_INCLUDE_DIR) | ||
set(nlohmann_json_FOUND YES) | ||
|
||
add_library(nlohmann_json INTERFACE) | ||
|
||
target_include_directories(nlohmann_json SYSTEM INTERFACE | ||
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>" | ||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | ||
|
||
else() | ||
set(nlohmann_json_FOUND NO) | ||
endif() | ||
endif() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
if (${BUILD_NLOHMANNJSON}) | ||
|
||
include (ExternalProject) | ||
ExternalProject_Add(nlohmann_json | ||
GIT_REPOSITORY https://github.com/nlohmann/json.git | ||
GIT_TAG master | ||
PREFIX "${THIRD_PARTY_DIR}/nlohmann_json" | ||
SOURCE_DIR "${THIRD_PARTY_DIR}/nlohmann_json/source" | ||
BINARY_DIR "${THIRD_PARTY_DIR}/nlohmann_json/build" | ||
INSTALL_DIR "${THIRD_PARTY_DIR}/lion/thirdparty" | ||
|
||
CONFIGURE_COMMAND ${CMAKE_COMMAND} | ||
-DJSON_BuildTests=OFF | ||
-DBUILD_TESTING=Off | ||
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_INSTALL_PREFIX:PATH=${THIRD_PARTY_DIR}/lion/thirdparty | ||
-DCMAKE_BUILD_TYPE:STRING=Release | ||
-DCMAKE_CXX_STANDARD=11 | ||
-DCMAKE_CXX_FLAGS=${windows_flag} | ||
${THIRD_PARTY_DIR}/nlohmann_json/source | ||
) | ||
|
||
endif() |
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