Skip to content

Eigen cmake library wrapper, because official cmake doesn't do what I want

License

Notifications You must be signed in to change notification settings

Naostage/eigen.cmake

Repository files navigation

eigen.cmake

Eigen cmake library wrapper, because official cmake is 💩

🔨 Build

# ⬇️ Download project from Github
git clone https://github.com/Naostage/eigen.cmake
cd eigen.cmake

# 🔧 Configure project
cmake -E make_directory build
cmake \
  -DEIGEN_ENABLE_EXAMPLES=ON `# 🚀 Enable Examples (eigen_example)` \
  -DEIGEN_ENABLE_INSTALL=ON `# 📦️ Enable Install` \
  -DEIGEN_ENABLE_FIND_PACKAGE=ON `# Enable find_package before cpm` \
  -B build -S .

# 🔨 Build:
cmake --build build --target eigen_example --config Release -j12

# 📦️ Install library (You can control installation path with -DCMAKE_INSTALL_PREFIX=mypath)
cmake --build . --target install

Extra flags

  • CPM_SOURCE_CACHE: Share CPM download with multiple build. More info.
  • CPM_USE_LOCAL_PACKAGES: Force CPMAddPackage to first try to find_package
  • EIGEN_ENABLE_FIND_PACKAGE: Enable find_package before CPMAddPackage. Off By Default
  • CMAKE_INSTALL_PREFIX: Select where installation should happen. More info

Use in your project

CPM

When using CPM, adding eigen.cmake to your project is as simple as:

CPMAddPackage(
  NAME eigen.cmake
  GIT_REPOSITORY "https://github.com/Naostage/eigen.cmake"
  GIT_TAG "v3.4.0"
)
target_link_libraries(mytarget PRIVATE Eigen3::Eigen)

find_package

One the library is installed you can simply:

find_package(Eigen3 REQUIRED)
target_link_libraries(mytarget PRIVATE Eigen3::Eigen)

Complete example can be found in examples/install.

💅 Format

📦️ Repository overview

repo-diagram

👥 Authors

About

Eigen cmake library wrapper, because official cmake doesn't do what I want

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages