From Roger James and Robert Osfield, clean up of COLLADA CMake support

This commit is contained in:
Robert Osfield 2009-06-12 09:41:10 +00:00
parent 77fcb5529d
commit fac2ffecb3
2 changed files with 74 additions and 99 deletions

View File

@ -127,8 +127,6 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
/usr/freeware/lib64 /usr/freeware/lib64
) )
IF(COLLADA_STATIC_LIBRARY)
# find extra libraries that the static linking requires # find extra libraries that the static linking requires
FIND_PACKAGE(LibXml2) FIND_PACKAGE(LibXml2)
@ -159,8 +157,6 @@ IF(COLLADA_STATIC_LIBRARY)
ENDIF(WIN32) ENDIF(WIN32)
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
IF(WIN32)
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY
NAMES pcrecpp NAMES pcrecpp
PATHS PATHS
@ -207,49 +203,34 @@ IF(COLLADA_STATIC_LIBRARY)
${COLLADA_DOM_ROOT}/external-libs/minizip/mac ${COLLADA_DOM_ROOT}/external-libs/minizip/mac
) )
ENDIF(WIN32)
ENDIF(COLLADA_STATIC_LIBRARY)
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
IF(WIN32)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem NAMES libboost_filesystem boost_filesystem
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
) )
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d NAMES libboost_filesystem-d boost_filesystem-d
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system NAMES libboost_system boost_system
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d NAMES libboost_system-d boost_system-d
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
) )
FIND_PATH(COLLADA_BOOST_INCLUDE_DIR boost/filesystem/convenience.hpp
${COLLADA_DOM_ROOT}/external-libs/boost
)
ENDIF(WIN32)
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
SET(COLLADA_FOUND "NO") SET(COLLADA_FOUND "NO")
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY) IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)

View File

@ -1,8 +1,4 @@
IF (WIN32) INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4)
INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4 ${COLLADA_BOOST_INCLUDE_DIR} )
ELSE ()
INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4)
ENDIF ()
SET(TARGET_SRC SET(TARGET_SRC
daeReader.cpp daeReader.cpp
@ -35,6 +31,8 @@ ELSE()
SET(COLLADA_USE_STATIC "NO") SET(COLLADA_USE_STATIC "NO")
ENDIF() ENDIF()
ADD_DEFINITIONS(-DNO_BOOST)
IF(COLLADA_USE_STATIC) IF(COLLADA_USE_STATIC)
IF(WIN32) IF(WIN32)
ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB) ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
@ -58,18 +56,14 @@ IF(COLLADA_USE_STATIC)
ENDIF() ENDIF()
ELSE() ELSE()
IF(WIN32) IF(WIN32)
ADD_DEFINITIONS(-DDOM_DYNAMIC -DBOOST_ALL_NO_LIB) ADD_DEFINITIONS(-DDOM_DYNAMIC)
SET(TARGET_LIBRARIES_VARS SET(TARGET_LIBRARIES_VARS COLLADA_DYNAMIC_LIBRARY)
COLLADA_DYNAMIC_LIBRARY
COLLADA_BOOST_SYSTEM_LIBRARY)
ELSE() ELSE()
SET(TARGET_LIBRARIES_VARS SET(TARGET_LIBRARIES_VARS
COLLADA_PCRECPP_LIBRARY
COLLADA_PCRE_LIBRARY
COLLADA_DYNAMIC_LIBRARY COLLADA_DYNAMIC_LIBRARY
COLLADA_BOOST_FILESYSTEM_LIBRARY COLLADA_BOOST_FILESYSTEM_LIBRARY)
COLLADA_BOOST_SYSTEM_LIBRARY)
ENDIF() ENDIF()
ENDIF() ENDIF()
SET(TARGET_ADDED_LIBRARIES osgSim ) SET(TARGET_ADDED_LIBRARIES osgSim )