# HG changeset patch # User koda # Date 1364118517 -3600 # Node ID b9a15738711e039c10df264644fd4984ba93f904 # Parent edceeafff671deb40c0b638058cbf3b72fe27c6f parsing CMAKE_OSX_ARCHITECTURES diff -r edceeafff671 -r b9a15738711e hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Fri Mar 22 10:43:43 2013 +0100 +++ b/hedgewars/CMakeLists.txt Sun Mar 24 10:48:37 2013 +0100 @@ -104,12 +104,17 @@ #DEPENDECIES AND EXECUTABLES SECTION if(APPLE) - string(REGEX MATCH "[pP][pP][cC]+" powerpc_build "${CMAKE_OSX_ARCHITECTURES}") - string(REGEX MATCH "[iI]386+" i386_build "${CMAKE_OSX_ARCHITECTURES}") - string(REGEX MATCH "[xX]86_64+" x86_64_build "${CMAKE_OSX_ARCHITECTURES}") - - if(powerpc_build) - set(powerpc_build "powerpc") + if(CMAKE_OSX_ARCHITECTURES) + #parse this system variable and adjust only the powerpc syntax to be compatible with -P + string(REGEX MATCH "[pP][pP][cC]+" powerpc_build "${CMAKE_OSX_ARCHITECTURES}") + string(REGEX MATCH "[iI]386+" i386_build "${CMAKE_OSX_ARCHITECTURES}") + string(REGEX MATCH "[xX]86_64+" x86_64_build "${CMAKE_OSX_ARCHITECTURES}") + if(powerpc_build) + set(powerpc_build "powerpc") + endif() + elseif(CMAKE_SIZEOF_VOID_P MATCHES "8") + #if that variable is not set check if we are on x86_64 and if so force it, else use default + add_flag_append(CMAKE_Pascal_FLAGS -Px86_64) endif() #on OSX we need to provide the SDL_main() function when building as executable