Skip to content

Commit 6fde77f

Browse files
committed
Updated JSON CMake recipe to use official target name
1 parent c0a687d commit 6fde77f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ endif()
9595

9696
# Json (MIT)
9797
include(json)
98-
target_link_libraries(jse PUBLIC nlohmann::json)
98+
target_link_libraries(jse PUBLIC nlohmann_json::nlohmann_json)
9999

100100
################################################################################
101101
# Compiler options

cmake/recipes/json.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#
1212

1313
# JSON MIT
14-
if(TARGET nlohmann::json)
14+
if(TARGET nlohmann_json::nlohmann_json)
1515
return()
1616
endif()
1717

18-
message(STATUS "Third-party: creating target 'nlohmann::json'")
18+
message(STATUS "Third-party: creating target 'nlohmann_json::nlohmann_json'")
1919

2020
# nlohmann_json is a big repo for a single header, so we just download the release archive
2121
set(NLOHMANNJSON_VERSION "v3.10.2")
@@ -29,7 +29,7 @@ FetchContent_Declare(
2929
FetchContent_MakeAvailable(nlohmann_json)
3030

3131
add_library(nlohmann_json INTERFACE)
32-
add_library(nlohmann::json ALIAS nlohmann_json)
32+
add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json)
3333

3434
include(GNUInstallDirs)
3535
target_include_directories(nlohmann_json INTERFACE

0 commit comments

Comments
 (0)