Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Linking Eigen to C++ plugin

Linking Eigen to C++ plugin

aburr48UPH
Observer Observer
540 Views
1 Reply
Message 1 of 2

Linking Eigen to C++ plugin

aburr48UPH
Observer
Observer

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.

0 Likes
541 Views
1 Reply
Reply (1)
Message 2 of 2

ZachGray
Enthusiast
Enthusiast
0 Likes