diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c97f3958..a40cb9f23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,9 @@ ELSE(USING_OSG_OP_OT_TRIPLE_SET) # MESSAGE("OSG: Not using Triple Set") FIND_PACKAGE(OpenThreads REQUIRED) -ENDIF(USING_OSG_OP_OT_TRIPLE_SET)# Find OpenGL +ENDIF(USING_OSG_OP_OT_TRIPLE_SET) + +# Find OpenGL FIND_PACKAGE(OpenGL) IF(APPLE) @@ -107,6 +109,8 @@ ENDIF(WIN32) # Common to all platforms: FIND_PACKAGE(FreeType) +# Common to all platforms: +FIND_PACKAGE(Inventor) # Platform specific: # (We can approach this one of two ways. We can try to FIND everything @@ -138,8 +142,6 @@ ELSE(NOT APPLE) ENDIF(NOT APPLE) - - ################################################################################ # Installation stuff diff --git a/CMakeModules/FindInventor.cmake b/CMakeModules/FindInventor.cmake new file mode 100644 index 000000000..57b71d4c9 --- /dev/null +++ b/CMakeModules/FindInventor.cmake @@ -0,0 +1,43 @@ +# - Locate Inventor +# This module defines: +# INVENTOR_FOUND, if false, do not try to link against Inventor. +# INVENTOR_LIBRARY, the library to link against. +# INVENTOR_INCLUDE_DIR, where to find headers. + +FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include +) + +FIND_LIBRARY(INVENTOR_LIBRARY + NAMES Coin + PATHS + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib +) +IF(NOT INVENTOR_LIBRARY) + # If we can't find libCoin try libInventor + FIND_LIBRARY(INVENTOR_LIBRARY + NAMES Inventor + PATHS + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + ) +ENDIF(NOT INVENTOR_LIBRARY) + +SET(INVENTOR_FOUND "NO") +IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY) + SET(INVENTOR_FOUND "YES") +ENDIF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY) diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index 2a7e8fa08..19a19570f 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -80,7 +80,9 @@ ENDIF (BUILD_OSG_IMAGE_PLUGINS) IF (BUILD_OSG_3D_PLUGINS) SET(TARGET_DEFAULT_LABEL_PREFIX "Plug 3d") ADD_SUBDIRECTORY(3dc) - #ADD_SUBDIRECTORY(Inventor) + IF(INVENTOR_FOUND) + ADD_SUBDIRECTORY(Inventor) + ENDIF(INVENTOR_FOUND) #ADD_SUBDIRECTORY(lwo) ADD_SUBDIRECTORY(x) ADD_SUBDIRECTORY(dw) diff --git a/src/osgPlugins/Inventor/CMakeLists.txt b/src/osgPlugins/Inventor/CMakeLists.txt new file mode 100644 index 000000000..b1ef35352 --- /dev/null +++ b/src/osgPlugins/Inventor/CMakeLists.txt @@ -0,0 +1,20 @@ +INCLUDE(OsgMacroUtils) + +SET(TARGET_SRC + ConvertFromInventor.cpp + GroupSoLOD.cpp + PendulumCallback.cpp + ReaderWriterIV.cpp + ShuttleCallback.cpp + ) +SET(TARGET_HDRS + ConvertFromInventor.h + GroupSoLOD.h + PendulumCallback.h + ReaderWriterIV.h + ShuttleCallback.h + ) + +SET(TARGET_EXTERNAL_LIBRARIES ${INVENTOR_LIBRARY} ) + +SETUP_PLUGIN(iv)