@@ -7,28 +7,19 @@ set(CMAKE_CXX_STANDARD 17)
77set (CMAKE_CXX_STANDARD_REQUIRED ON )
88set (CMAKE_CXX_EXTENSIONS OFF )
99
10- # Find and link BLAS/LAPACK (required by Armadillo)
11- find_package (BLAS REQUIRED )
12- find_package (LAPACK REQUIRED )
13-
1410include (FetchContent )
1511
16- ## # --- Armadillo vendoring using FetchContent ------------------------------
12+ # --- Armadillo vendoring using FetchContent ------------------------------
1713set (ARMADILLO_VERSION "15.0.2" )
14+ set (HEADER_ONLY ON CACHE BOOL "Build Armadillo header-only" )
1815
19- # By setting SOURCE_SUBDIR to a non-existing path, we prevent automatic
20- # add_subdirectory in FetchContent_MakeAvailable.
21- # https://gitlab.kitware.com/cmake/cmake/-/issues/26220
2216FetchContent_Declare (
2317 armadillo_vendored
2418 URL "https://sourceforge.net/projects/arma/files/armadillo-${ARMADILLO_VERSION} .tar.xz/download"
2519 URL_HASH SHA256=990ab4ccb7eff1b6d70409e9aa7fa4119877ac5f5d10ba219e98460ab3e4d6eb
2620 DOWNLOAD_EXTRACT_TIMESTAMP true
27- SOURCE_SUBDIR "PATH_THAT_DOES_NOT_EXIST" # Prevents automatic add_subdirectory
2821)
2922FetchContent_MakeAvailable (armadillo_vendored)
30- add_library (armadillo INTERFACE )
31- target_include_directories (armadillo INTERFACE "${armadillo_vendored_SOURCE_DIR} /include" )
3223
3324# --- Core library --------------------------------------------------------
3425add_library (ppca STATIC
@@ -42,5 +33,5 @@ target_include_directories(ppca PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
4233# Ensure the static library is built as PIC so it can be linked into a shared module
4334set_target_properties (ppca PROPERTIES POSITION_INDEPENDENT_CODE ON )
4435
45- # Link to Armadillo target and system BLAS/LAPACK
46- target_link_libraries (ppca PUBLIC armadillo ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} )
36+ # Link to Armadillo target
37+ target_link_libraries (ppca PUBLIC armadillo )
0 commit comments