From: Diane Trout Date: Sat, 3 Feb 2007 01:55:46 +0000 (+0000) Subject: detect 64bit processors and add -fPIC X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=974e1b5bb6822a96aac25f5e35d1405b0c36b279 detect 64bit processors and add -fPIC this is an intermediate solution as I probably can use ADD_DEFINES() to add the command line options for the compiler instead of fiddingly with CMAKE variables Props to Brandon for finding the solution in an openwengo patch. http://dev.openwengo.org/trac/openwengo/trac.cgi/changeset/9139 Long Live CMake! --- diff --git a/makelib/Platform.cmake b/makelib/Platform.cmake index 87d8164..ee55fec 100644 --- a/makelib/Platform.cmake +++ b/makelib/Platform.cmake @@ -16,14 +16,16 @@ ELSE(PYTHONINTERP_FOUND) SET(PYTHON_LINKFORSTATIC "") ENDIF(PYTHONINTERP_FOUND) -MACRO(GET_MUSSA_COMPILE_FLAGS return) - SET(return "") - IF(APPLE) - SET(${return} - ${${return}} - "-isysroot /Developer/SDKS/MacOSX10.4u.sdk -arch ppc -arch i386 -I/usr/local/include" - ) - ENDIF(APPLE) +MACRO(GET_MUSSA_COMPILE_FLAGS) + SET(${return} "") + IF(APPLE) + ADD_DEFINITIONS("-isysroot /Developer/SDKS/MacOSX10.4u.sdk -arch ppc -arch i386 -I/usr/local/include") + ENDIF(APPLE) + IF (UNIX AND NOT WIN32) + IF (CMAKE_SIZEOF_VOID_P MATCHES "8") + ADD_DEFINITIONS("-fPIC") + ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8") + ENDIF(UNIX AND NOT WIN32) ENDMACRO(GET_MUSSA_COMPILE_FLAGS) MACRO(GET_MUSSA_LINK_FLAGS return)