Browse Source

CMake: Use proper target_use_packages definitions for Eigen

Sam Edwards 7 years ago
parent
commit
5c4ef25bb7

+ 0 - 6
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.")

+ 1 - 4
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

+ 1 - 1
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_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)
-target_use_packages(p3dtoolbase THREADS)
+target_use_packages(p3dtoolbase THREADS EIGEN)
 target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT})
 
 install(TARGETS p3dtoolbase DESTINATION lib)

+ 0 - 3
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()

+ 1 - 0
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)