Finds the Armadillo C++ library:
find_package(Armadillo [<version>] [...])
Armadillo is a library for linear algebra and scientific computing.
Added in version 3.18: Support for linking wrapped libraries directly (see the
ARMA_DONT_USE_WRAPPER preprocessor macro that needs to be defined before
including the <armadillo> header).
This module defines the following variables:
Armadillo_FOUNDAdded in version 3.3.
Boolean indicating whether the (requested version of) Armadillo library was found.
Armadillo_VERSIONAdded in version 4.2.
The version of Armadillo found (e.g., 14.90.0).
Armadillo_VERSION_NAMEAdded in version 4.2.
The version name of Armadillo found (e.g., Antipodean Antileech).
ARMADILLO_INCLUDE_DIRSList of required include directories.
ARMADILLO_LIBRARIESList of libraries to be linked.
The following variables are provided for backward compatibility:
ARMADILLO_FOUNDDeprecated since version 4.2: Use Armadillo_FOUND, which has the same value.
Boolean indicating whether the (requested version of) Armadillo library was found.
ARMADILLO_VERSION_STRINGDeprecated since version 4.2: Superseded by the Armadillo_VERSION.
The version of Armadillo found.
ARMADILLO_VERSION_MAJORDeprecated since version 4.2: Superseded by the Armadillo_VERSION.
Major version number.
ARMADILLO_VERSION_MINORDeprecated since version 4.2: Superseded by the Armadillo_VERSION.
Minor version number.
ARMADILLO_VERSION_PATCHDeprecated since version 4.2: Superseded by the Armadillo_VERSION.
Patch version number.
ARMADILLO_VERSION_NAMEDeprecated since version 4.2: Superseded by the Armadillo_VERSION_NAME.
The version name of Armadillo found (e.g., Antipodean Antileech).
Finding Armadillo and creating an imported target:
find_package(Armadillo REQUIRED)
if(Armadillo_FOUND AND NOT TARGET Armadillo::Armadillo)
add_library(Armadillo::Armadillo INTERFACE IMPORTED)
set_target_properties(
Armadillo::Armadillo
PROPERTIES
INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}"
)
endif()
add_executable(foo foo.cc)
target_link_libraries(foo PRIVATE Armadillo::Armadillo)