Browse Source

Move conditional includes to panda/CMakeLists.txt so they don't have to be repeated everywhere.

kestred 12 years ago
parent
commit
83c60dc187

+ 14 - 1
panda/CMakeLists.txt

@@ -2,6 +2,19 @@ if(NOT BUILD_DTOOL)
   message(FATAL_ERROR "Cannot build panda without dtool!  Please enable the BUILD_DTOOL option.")
   message(FATAL_ERROR "Cannot build panda without dtool!  Please enable the BUILD_DTOOL option.")
 endif()
 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()
+if(HAVE_CG)
+  include_directories(${CG_INCLUDE_DIRS})
+endif()
+
 # Include panda source directories
 # Include panda source directories
 add_subdirectory(src/pandabase)
 add_subdirectory(src/pandabase)
 add_subdirectory(src/express)
 add_subdirectory(src/express)
@@ -16,8 +29,8 @@ add_subdirectory(src/gsgbase)
 add_subdirectory(src/pnmimage)
 add_subdirectory(src/pnmimage)
 add_subdirectory(src/gobj)
 add_subdirectory(src/gobj)
 add_subdirectory(src/pgraph)
 add_subdirectory(src/pgraph)
-
 add_subdirectory(src/cull)
 add_subdirectory(src/cull)
+
 #add_subdirectory(src/display)
 #add_subdirectory(src/display)
 #add_subdirectory(src/framework)
 #add_subdirectory(src/framework)
 #add_subdirectory(src/testbed)
 #add_subdirectory(src/testbed)

+ 0 - 4
panda/src/cull/CMakeLists.txt

@@ -20,10 +20,6 @@ set(P3CULL_SOURCES
   drawCullHandler.cxx
   drawCullHandler.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-
 composite_sources(p3cull P3CULL_SOURCES)
 composite_sources(p3cull P3CULL_SOURCES)
 add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES})
 add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES})
 target_link_libraries(p3cull p3pgraph)
 target_link_libraries(p3cull p3pgraph)

+ 0 - 8
panda/src/gobj/CMakeLists.txt

@@ -141,14 +141,6 @@ set(P3GOBJ_SOURCES
   videoTexture.cxx
   videoTexture.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-
-if(HAVE_CG)
-  include_directories(${CG_INCLUDE_DIRS})
-endif()
-
 composite_sources(p3gobj P3GOBJ_SOURCES)
 composite_sources(p3gobj P3GOBJ_SOURCES)
 add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES})
 add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES})
 target_link_libraries(p3gobj p3gsgbase p3pnmimage)
 target_link_libraries(p3gobj p3gsgbase p3pnmimage)

+ 0 - 7
panda/src/gsgbase/CMakeLists.txt

@@ -12,13 +12,6 @@ set(P3GSGBASE_SOURCES
   graphicsStateGuardianBase.cxx
   graphicsStateGuardianBase.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-if(HAVE_CG)
-  include_directories(${CG_INCLUDE_DIRS})
-endif()
-
 composite_sources(p3gsgbase P3GSGBASE_SOURCES)
 composite_sources(p3gsgbase P3GSGBASE_SOURCES)
 add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES})
 add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES})
 target_link_libraries(p3gsgbase p3linmath)
 target_link_libraries(p3gsgbase p3linmath)

+ 0 - 4
panda/src/linmath/CMakeLists.txt

@@ -42,10 +42,6 @@ set(P3LINMATH_SOURCES
   lvector2.cxx lvector3.cxx lvector4.cxx mathNumbers.cxx
   lvector2.cxx lvector3.cxx lvector4.cxx mathNumbers.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-
 composite_sources(p3linmath P3LINMATH_SOURCES)
 composite_sources(p3linmath P3LINMATH_SOURCES)
 add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES})
 add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES})
 target_link_libraries(p3linmath p3putil)
 target_link_libraries(p3linmath p3putil)

+ 0 - 7
panda/src/mathutil/CMakeLists.txt

@@ -60,13 +60,6 @@ set(P3MATHUTIL_SOURCES
   unionBoundingVolume.cxx
   unionBoundingVolume.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-if(HAVE_FFTW)
-  include_directories(${FFTW2_INCLUDE_DIR})
-endif()
-
 composite_sources(p3mathutil P3MATHUTIL_SOURCES)
 composite_sources(p3mathutil P3MATHUTIL_SOURCES)
 add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES})
 add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES})
 target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}})
 target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}})

+ 0 - 4
panda/src/pgraph/CMakeLists.txt

@@ -196,10 +196,6 @@ set(P3PGRAPH_SOURCES
   workingNodePath.cxx
   workingNodePath.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-
 composite_sources(p3pgraph P3PGRAPH_SOURCES)
 composite_sources(p3pgraph P3PGRAPH_SOURCES)
 add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES})
 add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES})
 target_link_libraries(p3pgraph p3gobj)
 target_link_libraries(p3pgraph p3gobj)

+ 0 - 4
panda/src/pnmimage/CMakeLists.txt

@@ -24,10 +24,6 @@ set(P3PNMIMAGE_SOURCES
   ppmcmap.cxx
   ppmcmap.cxx
 )
 )
 
 
-if(HAVE_EIGEN)
-  include_directories(${EIGEN3_INCLUDE_DIR})
-endif()
-
 composite_sources(p3pnmimage P3PNMIMAGE_SOURCES)
 composite_sources(p3pnmimage P3PNMIMAGE_SOURCES)
 add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES})
 add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES})
 target_link_libraries(p3pnmimage p3mathutil)
 target_link_libraries(p3pnmimage p3mathutil)