I don't think this will work. The first approach relies on
CMAKE_BUILD_TYPE, which is only applicable to make based generators. I
build my project on Mac OS X using Xcode, which is not make based, at
least in this context.
The second solution just reverses the problem. By this I mean that,
before the upgrade, CMake would configure a project that built for the
specific architecture during debug builds and universal binaries for
release builds. Applying the second approach would not allow for a
universal binary to be built for release builds. I supposed this would
not be a catastrophe. There are some project that only release
architecture specific version of their products instead of universal
binaries. Still, I would expect CMake to offer the flexibility of
configuring the project in whatever manner is desired.
On 5-2-2010 10:04, Richard Wackerbarth wrote:
You might try this approach:
Since you want to use 32-bit on MacOSX 10.6, when in debug, set the
architecture only in your particular case
cmake_minimum_required(VERSION 2.4)
PROJECT(Test)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Message("${CMAKE_SYSTEM_VERSION}")
STRING (REGEX MATCH "^[^.]+" __v ${CMAKE_SYSTEM_VERSION} )
STRING (REGEX MATCH "[0-9][0-9]$" __version "00${__v}" )
STRING (COMPARE GREATER ${__version} "09"
_host_is_snow_leopard_or_newer )
IF (${_host_is_snow_leopard_or_newer})
IF (x${CMAKE_BUILD_TYPE} STREQUAL "xDebug")
SET (CMAKE_OSX_ARCHITECTURES "i386")
ENDIF (x${CMAKE_BUILD_TYPE} STREQUAL "xDebug")
ENDIF (${_host_is_snow_leopard_or_newer})
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ADD_EXECUTABLE(HelloWorld Hello)
or this approach
IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
SET (CMAKE_OSX_ARCHITECTURES "i386")
ENDIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
Richard
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake