diff --git a/CMakeModules/FindInventor.cmake b/CMakeModules/FindInventor.cmake index 07dabbcaa..a3f14d0aa 100644 --- a/CMakeModules/FindInventor.cmake +++ b/CMakeModules/FindInventor.cmake @@ -1,8 +1,9 @@ # - 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. +# INVENTOR_LIBRARY, the library to link against. +# INVENTOR_LIBRARY_DEBUG, the debug library to link against. FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h /usr/local/include @@ -11,10 +12,11 @@ FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h /opt/local/include /opt/csw/include /opt/include + $ENV{COINDIR}/include ) FIND_LIBRARY(INVENTOR_LIBRARY - NAMES Coin + NAMES coin2 Coin PATHS /usr/local/lib /usr/lib @@ -22,6 +24,7 @@ FIND_LIBRARY(INVENTOR_LIBRARY /opt/local/lib /opt/csw/lib /opt/lib + $ENV{COINDIR}/lib ) IF(NOT INVENTOR_LIBRARY) # If we can't find libCoin try libInventor @@ -37,6 +40,23 @@ IF(NOT INVENTOR_LIBRARY) ) ENDIF(NOT INVENTOR_LIBRARY) +FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG + NAMES coin2d + PATHS + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + $ENV{COINDIR}/lib +) +IF(NOT INVENTOR_LIBRARY_DEBUG) + IF(INVENTOR_LIBRARY) + SET(INVENTOR_LIBRARY_DEBUG INVENTOR_LIBRARY) + ENDIF(INVENTOR_LIBRARY) +ENDIF(NOT INVENTOR_LIBRARY_DEBUG) + SET(INVENTOR_FOUND "NO") IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY) SET(INVENTOR_FOUND "YES") diff --git a/src/osgPlugins/Inventor/CMakeLists.txt b/src/osgPlugins/Inventor/CMakeLists.txt index 01556c4e0..1c4d08192 100644 --- a/src/osgPlugins/Inventor/CMakeLists.txt +++ b/src/osgPlugins/Inventor/CMakeLists.txt @@ -22,6 +22,8 @@ SET(TARGET_HDRS ShuttleCallback.h ) +ADD_DEFINITIONS(-DCOIN_DLL) + SET(TARGET_EXTERNAL_LIBRARIES ${INVENTOR_LIBRARY} ) SETUP_PLUGIN(iv)