diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 8ad74df904..a20434d80b 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -412,12 +412,6 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # Now let's check for the presence of various thirdparty libraries. # -# Always include Eigen, because we include it pretty much everywhere. -if(EIGEN3_FOUND) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - - # Is Python installed, and should Python interfaces be generated? set(WANT_PYTHON_VERSION "2.7" CACHE STRING "Which Python version to seek out for building Panda3D against.") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 244c739846..a115cb118e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -3,10 +3,6 @@ # find_package(Eigen3 QUIET) -if(Eigen3_FOUND) - set(EIGEN_FOUND ON) -endif() - package_option(EIGEN "Enables experimental support for the Eigen linear algebra library. If this is provided, Panda will use this library as the fundamental @@ -14,6 +10,7 @@ implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN is also enabled." + FOUND_AS EIGEN3 LICENSE "MPL-2") option(LINMATH_ALIGN diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 642f1d95e6..29605d602e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -73,7 +73,7 @@ add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC $) -target_use_packages(p3dtoolbase THREADS) +target_use_packages(p3dtoolbase THREADS EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6dca58d075..e781ae96a3 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -5,9 +5,6 @@ endif() # Not sure where I want to hide these inludes yet, but it is annoying # to have to add them to every CMakeLists that either directly, or # recursively includes linmath, and other libraries etc... -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() if(HAVE_FFTW) include_directories(${FFTW2_INCLUDE_DIR}) endif() diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index be69df108f..be9d1dcfa5 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -46,6 +46,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3express p3pandabase) +target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) install(TARGETS p3linmath DESTINATION lib)