From 1cc0b095521ced3b73da4e87149c8cebfc846e9e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 23 Mar 2009 16:11:41 +0000 Subject: [PATCH] From Michael Platings, "I've changed this file so CMake automatically chooses the correct directories & libs out of vc8,vc9,mac,mingw Tested with Visual Studio 9 2008" --- CMakeModules/FindCOLLADA.cmake | 51 ++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/CMakeModules/FindCOLLADA.cmake b/CMakeModules/FindCOLLADA.cmake index 3b3eea4f4..b1848517a 100644 --- a/CMakeModules/FindCOLLADA.cmake +++ b/CMakeModules/FindCOLLADA.cmake @@ -15,6 +15,17 @@ SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory") +IF(APPLE) + SET(COLLADA_BUILDNAME "mac") +ELSEIF(MINGW) + SET(COLLADA_BUILDNAME "mingw") +ELSEIF(MSVC90) + SET(COLLADA_BUILDNAME "vc9") +ELSE(APPLE) + SET(COLLADA_BUILDNAME "vc8") +ENDIF(APPLE) + + FIND_PATH(COLLADA_INCLUDE_DIR dae.h ${COLLADA_DOM_ROOT}/include $ENV{COLLADA_DIR}/include @@ -39,8 +50,8 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY NAMES collada_dom collada14dom libcollada14dom21 PATHS - ${COLLADA_DOM_ROOT}/build/vc8-1.4 - $ENV{COLLADA_DIR}/build/vc8-1.4 + ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4 + $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4 $ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR} @@ -64,8 +75,8 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG NAMES collada_dom-d collada14dom-d libcollada14dom21-d PATHS - ${COLLADA_DOM_ROOT}/build/vc8-1.4-d - $ENV{COLLADA_DIR}/build/vc8-1.4-d + ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d + $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d $ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR} @@ -89,8 +100,8 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_STATIC_LIBRARY NAMES libcollada14dom21-s PATHS - ${COLLADA_DOM_ROOT}/build/vc8-1.4 - $ENV{COLLADA_DIR}/build/vc8-1.4 + ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4 + $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4 $ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR} @@ -114,8 +125,8 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd PATHS - ${COLLADA_DOM_ROOT}/build/vc8-1.4-d - $ENV{COLLADA_DIR}/build/vc8-1.4-d + ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d + $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d $ENV{COLLADA_DIR}/lib $ENV{COLLADA_DIR}/lib-dbg $ENV{COLLADA_DIR} @@ -173,8 +184,7 @@ IF(COLLADA_STATIC_LIBRARY) FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY NAMES pcrecpp PATHS - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw ) @@ -182,8 +192,7 @@ IF(COLLADA_STATIC_LIBRARY) FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY_DEBUG NAMES pcrecpp-d PATHS - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw ) @@ -191,8 +200,7 @@ IF(COLLADA_STATIC_LIBRARY) FIND_LIBRARY(COLLADA_PCRE_LIBRARY NAMES pcre PATHS - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw ) @@ -200,8 +208,7 @@ IF(COLLADA_STATIC_LIBRARY) FIND_LIBRARY(COLLADA_PCRE_LIBRARY_DEBUG NAMES pcre-d PATHS - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac ${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw ) @@ -231,32 +238,28 @@ IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY) FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY NAMES libboost_filesystem PATHS - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ) FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG NAMES libboost_filesystem-d PATHS - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ) FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY NAMES libboost_system PATHS - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ) FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG NAMES libboost_system-d PATHS - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8 - ${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9 + ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw )