CMake: Detect PPC compilation on Mac OSX and use correct libs. Also add OpenEXR threa...
authorJacques Beuarain <jacques.beaurain@gmail.com>
Thu, 30 Nov 2006 11:59:59 +0000 (11:59 +0000)
committerJacques Beuarain <jacques.beaurain@gmail.com>
Thu, 30 Nov 2006 11:59:59 +0000 (11:59 +0000)
CMakeLists.txt

index 74ff9e462c6a76a92c3d3f94f5921abc6b213209..76ef9961fa03721819ed230098141af1be68cb7a 100644 (file)
@@ -263,7 +263,11 @@ IF(WIN32)
 ENDIF(WIN32)
 
 IF(APPLE)
-  SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
+  IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+    SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
+  ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+    SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
+  ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
 
   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
   IF(OPENAL_FOUND)
@@ -301,7 +305,11 @@ IF(APPLE)
 
   SET(OPENEXR ${LIBDIR}/openexr)
   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR)
-  SET(OPENEXR_LIB Iex Half IlmImf Imath)
+  IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+    SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
+  ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+    SET(OPENEXR_LIB Iex Half IlmImf Imath)
+  ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
 
   SET(LLIBS stdc++ SystemStubs)