Message 1 of 2
Linking Eigen to C++ plugin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to link the Eigen library to a maya plugin but I can't figure out how to configure CMakeLists.txt correctly. I've been able to link it to a standalone executable, but my CMake skills are weak and I can't seem to link it to the plugin.
This naive attempt:
cmake_minimum_required(VERSION 3.22.1)
set(PROJECT_NAME testDeformer)
project(${PROJECT_NAME})
include($ENV{DEVKIT_LOCATION}/cmake/pluginEntry.cmake)
set(SOURCE_FILES
testDeformer.cpp
)
find_package (Eigen3)
set(LIBRARIES
OpenMaya Foundation Eigen3
)
build_plugin()
produces the error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Eigen3_PATH
and adding the install location:
set(Eigen3_PATH /opt/homebrew/include/eigen3)
causes:
Target "linearDeformer" requests linking to directory
"/opt/homebrew/include/eigen3". Targets may link only to libraries. CMake
is dropping the item.
Thanks for the help.