Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FetchContent_MakeAvailable for asio and eigen #1275

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
13 changes: 5 additions & 8 deletions tests/eigen_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ project(eigen_test)

add_executable(${PROJECT_NAME} ${PROJECT_NAME}.cpp)

find_package (Eigen3 3.4 QUIET)
find_package (Eigen3 3.4 QUIET NO_MODULE)
if(NOT Eigen3_FOUND)
FetchContent_Declare(
Eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
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}")
FetchContent_MakeAvailable(Eigen3)
# Exclude Eigen tests from being run by default
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_TESTING OFF)
endif()
endif()

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

Expand Down