diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2009-10-19 18:38:19 +0400 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2009-10-19 18:38:19 +0400 |
commit | 8d7c69ffa922d4d360b1eabe114e0f8e0e6a28e2 (patch) | |
tree | d1a3515c450830e07a7420516a2a5f9265afb8d2 | |
parent | 54abd775d33ef35a217bb26413341c67fc638fed (diff) |
CMake files update to allow use of MAC OSX 10.5 libs (and build 64bit blender on mac)
The WITH_LIBS10.5 option switches the use of the libs included in the darwin-9.x.universal folder
Use the CMAKE_OSX_ARCHITECTURES variable to set the architecture you want to build for (e.g. i386, x86_64). Only one at a time, this value is used to select the python_?.zip that is bundled with the app.
WITH_COCOA (build Cocoa ghost and not Carbon) is now on by default.
-rw-r--r-- | CMakeLists.txt | 34 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 7 |
2 files changed, 26 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d53f4ed9966..55d5956783c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,8 @@ OPTION(WITH_BUILDINFO "Include extra build details" ON) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF (APPLE) -OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" OFF) +OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON) +OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF) ENDIF (APPLE) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) @@ -396,17 +397,22 @@ IF(WIN32) ENDIF(WIN32) IF(APPLE) - 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) + IF(WITH_LIBS10.5) + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal) + ELSE(WITH_LIBS10.5) + 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) + ENDIF(WITH_LIBS10.5) + IF(WITH_OPENAL) FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) SET(WITH_OPENAL ON) - SET(OPENAL_INCLUDE_DIR "${OPENAL_INCLUDE_DIR};${LIBDIR}/openal/include") + SET(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include") ELSE(OPENAL_FOUND) SET(WITH_OPENAL OFF) ENDIF(OPENAL_FOUND) @@ -432,20 +438,20 @@ IF(APPLE) # we use precompiled libraries for py 3.1 and up by default SET(PYTHON ${LIBDIR}/python) - SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet + SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") + # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet SET(PYTHON_LIB python${PYTHON_VERSION}) - SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "") + SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}") # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled ELSE(PYTHON_VERSION MATCHES 3.1) # otherwise, use custom system framework SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) SET(PYTHON_VERSION 2.5) - SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet + SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}") + # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet SET(PYTHON_LIB "") - SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") + SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config) SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") ENDIF(PYTHON_VERSION MATCHES 3.1) @@ -457,7 +463,7 @@ IF(APPLE) IF(WITH_FFTW3) SET(FFTW3 ${LIBDIR}/fftw3) SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) + SET(FFTW3_LIB fftw3) SET(FFTW3_LIBPATH ${FFTW3}/lib) ENDIF(WITH_FFTW3) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index bef41983bab..28985daf466 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -225,11 +225,16 @@ IF(WITH_INSTALL) ENDIF(WITH_INTERNATIONAL) IF(WITH_PYTHON) + IF(WITH_LIBS10.5) + SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip") + ELSE(WITH_LIBS10.5) + SET(PYTHON_ZIP "python.zip") + ENDIF(WITH_LIBS10.5) ADD_CUSTOM_COMMAND( TARGET blender POST_BUILD MAIN_DEPENDENCY blender COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ - COMMAND unzip -q ${LIBDIR}/release/python.zip -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ + COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;" ) ENDIF(WITH_PYTHON) |