Reorganize CMake and minimize configuration for non-top-level builds.

This commit is contained in:
Antonio Sánchez 2024-05-01 17:42:53 +00:00
parent c1d637433e
commit 9700fc847a
4 changed files with 604 additions and 576 deletions

File diff suppressed because it is too large Load Diff

View File

@ -91,6 +91,7 @@ macro(ei_add_test_internal testname testname_with_suffix)
if(EIGEN_TEST_CUSTOM_LINKER_FLAGS)
target_link_libraries(${targetname} ${EIGEN_TEST_CUSTOM_LINKER_FLAGS})
endif()
target_link_libraries(${targetname} Eigen3::Eigen)
if(${ARGC} GREATER 3)
set(libs_to_link ${ARGV3})

View File

@ -110,6 +110,7 @@ foreach(target IN LISTS EIGEN_LAPACK_TARGETS)
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
endif()
target_link_libraries(${target} Eigen3::Eigen)
add_dependencies(lapack ${target})
install(TARGETS ${target}
RUNTIME DESTINATION bin

View File

@ -4,7 +4,7 @@ if(EIGEN_BUILD_DOC)
endif()
if(EIGEN_BUILD_TESTING)
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
add_subdirectory(test) # CTest automatic test building relies on the "all" target.
else()
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()