Skip to content

Commit cb28427

Browse files
committed
CMake 3.18 can use FetchContent_MakeAvailable as long as there is no SOURCE_SUBDIR
1 parent 6c9f2ea commit cb28427

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

metatomic-torch/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,7 @@ FetchContent_Declare(nlohmann_json
193193
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
194194
URL_HASH SHA256=d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d
195195
)
196-
if (CMAKE_VERSION VERSION_GREATER 3.18)
197-
FetchContent_MakeAvailable(nlohmann_json)
198-
else()
199-
if (NOT nlohmann_json_POPULATED)
200-
FetchContent_Populate(nlohmann_json)
201-
endif()
202-
203-
add_subdirectory(${nlohmann_json_SOURCE_DIR} ${nlohmann_json_BINARY_DIR})
204-
endif()
196+
FetchContent_MakeAvailable(nlohmann_json)
205197

206198
target_link_libraries(metatomic_torch PRIVATE nlohmann_json::nlohmann_json)
207199

0 commit comments

Comments
 (0)