Skip to content

Commit

Permalink
Use FetchContent_MakeAvailable for asio and eigen
Browse files Browse the repository at this point in the history
CMake 3.30 deprecates FetchContent_Populate as CMP0169.  FetchContent_MakeAvailable is already used in tests/CMakeLists.txt so this should not cause any problems for people on older versions of CMake.

Tested:
Built and ran tests using default container with LLVM-19 and CMake 3.30.2 on x86_64 without eigen installed on the image.
  • Loading branch information
kaladron committed Sep 7, 2024
1 parent 6115adf commit 6ab6e63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions tests/asio_repe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ FetchContent_Declare(
GIT_TAG asio-1-30-1
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(asio)
if(NOT asio_POPULATED)
FetchContent_Populate(asio)
endif()
FetchContent_MakeAvailable(asio)

add_subdirectory(server)
add_subdirectory(client)
8 changes: 1 addition & 7 deletions tests/eigen_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ if(NOT Eigen3_FOUND)
GIT_TAG 3.4.0
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(Eigen3)
if(NOT eigen3_POPULATED)
FetchContent_Populate(Eigen3)
add_library(Eigen3 INTERFACE IMPORTED GLOBAL)
add_library(Eigen3::Eigen ALIAS Eigen3)
target_include_directories(Eigen3 INTERFACE "${eigen3_SOURCE_DIR}")
endif()
FetchContent_MakeAvailable(Eigen3)
endif()

target_link_libraries(${PROJECT_NAME} PRIVATE glz_test_common Eigen3::Eigen)
Expand Down

0 comments on commit 6ab6e63

Please sign in to comment.