FindArmadillo

尋找 Armadillo C++ 程式庫:

find_package(Armadillo [<version>] [...])

Armadillo is a library for linear algebra and scientific computing.

在 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).

結果變數

該模組定義了以下變數:

Armadillo_FOUND

在 3.3 版被加入.

Boolean indicating whether the (requested version of) Armadillo library was found.

Armadillo_VERSION

在 4.2 版被加入.

找到的 Armadillo 的版本(例如:14.90.0)。

Armadillo_VERSION_NAME

在 4.2 版被加入.

The version name of Armadillo found (e.g., Antipodean Antileech).

ARMADILLO_INCLUDE_DIRS

List of required include directories.

ARMADILLO_LIBRARIES

List of libraries to be linked.

已棄用的變數

The following variables are provided for backward compatibility:

ARMADILLO_FOUND

在 4.2 版之後被棄用: Use Armadillo_FOUND, which has the same value.

Boolean indicating whether the (requested version of) Armadillo library was found.

ARMADILLO_VERSION_STRING

在 4.2 版之後被棄用: Superseded by the Armadillo_VERSION.

找到的 Armadillo 的版本。

ARMADILLO_VERSION_MAJOR

在 4.2 版之後被棄用: Superseded by the Armadillo_VERSION.

主版本號。

ARMADILLO_VERSION_MINOR

在 4.2 版之後被棄用: Superseded by the Armadillo_VERSION.

次版本號。

ARMADILLO_VERSION_PATCH

在 4.2 版之後被棄用: Superseded by the Armadillo_VERSION.

補丁版本號。

ARMADILLO_VERSION_NAME

在 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)