Skip to content

Commit

Permalink
Change FetchContent_Populate to FetchContent_MakeAvailable
Browse files Browse the repository at this point in the history
According to https://cmake.org/cmake/help/latest/module/FetchContent.html#command:fetchcontent_populate, FetchContent_MakeAvailable ensures the named
dependencies have been populated, either by an earlier call, or by populating them itself.

This makes possible to get rid of the conditional.
  • Loading branch information
imorlxs committed Aug 23, 2024
1 parent d8bb6b7 commit b975047
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,9 @@ Unset the environment variable BDM_LOCAL_LFS to download the file.")
DOWNLOAD_DIR ${DEST_PARENT}
SOURCE_DIR ${DEST}
)

FetchContent_GetProperties(${TAR_FILENAME})
if (NOT ${TAR_FILENAME}_POPULATED)
FetchContent_Populate(${TAR_FILENAME})
endif()


FetchContent_MakeAvailable(${TAR_FILENAME})

# Remove subbuild files, we don't need them
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/)
endif()
Expand Down

0 comments on commit b975047

Please sign in to comment.