Skip to content

Commit

Permalink
Specify required versions of dependencies, emit own version file.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jun 22, 2024
1 parent d169a8e commit f9be23d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ option(IRLBA_FETCH_EXTERN "Automatically fetch CppIrlba's dependencies." ON)
if(IRLBA_FETCH_EXTERN)
add_subdirectory(extern)
else()
find_package(Eigen3 CONFIG REQUIRED)
find_package(ltla_aarand CONFIG REQUIRED)
find_package(Eigen3 3.4.0 CONFIG REQUIRED)
find_package(ltla_aarand 1.0.0 CONFIG REQUIRED)
endif()

target_link_libraries(irlba INTERFACE Eigen3::Eigen ltla::aarand)
Expand Down Expand Up @@ -57,5 +57,10 @@ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/ltla_irlbaConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ltla_irlba)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ltla_irlbaConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ltla_irlbaConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ltla_irlbaConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ltla_irlba)
4 changes: 2 additions & 2 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(Eigen3 CONFIG REQUIRED)
find_dependency(ltla_aarand CONFIG REQUIRED)
find_dependency(Eigen3 3.4.0 CONFIG REQUIRED)
find_dependency(ltla_aarand 1.0.0 CONFIG REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/ltla_irlbaTargets.cmake")
2 changes: 1 addition & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FetchContent_MakeAvailable(eigen)
FetchContent_Declare(
aarand
GIT_REPOSITORY https://github.com/LTLA/aarand
GIT_TAG 84d48b65d49ce8b844398f11aff3015b86e17197
GIT_TAG master # ^1.0.0
)

FetchContent_MakeAvailable(aarand)

0 comments on commit f9be23d

Please sign in to comment.