source: PSPA/madxPSPA/cmake/setupArchSpecifics.cmake @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.6 KB
Line 
1if ( IS32BIT )
2    message(STATUS "32 bit build" ) 
3   
4    set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
5           
6    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
7        if ( MADX_STATIC )
8            set (CPACK_RPM_PACKAGE_ARCHITECTURE "noarch")
9            # I think this should be correct but it is not tested yet...
10            #set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
11        else ()
12            if ( NOT MADX_FORCE_32 )
13                set (CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
14            else ()
15                    message(WARNING "Don't use CPACK to generate RPM, it will make no sense for these settings.")
16            endif ()
17        endif ()
18    endif()
19   
20    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
21    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
22
23    if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND MADX_STATIC)
24        LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib32)
25    endif ()
26 
27else()
28
29    message(STATUS "64 bit build")
30   
31    set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
32    set (CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
33   
34    if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND MADX_STATIC)
35            LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib64)
36    endif ()
37endif ()
38
39
40# OSX specifics:
41if (APPLE)
42    set(CMAKE_LIBRARY_PATH /usr/lib/ /usr/X11/lib/ ${CMAKE_LIBRARY_PATH})
43    # This does not work for 10.7 or above, so commenting out for now
44    # I think it is just some cpack related option..
45    # set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
46endif (APPLE)
47
48if (WIN32)
49   add_definitions("-D_WIN32")
50elseif(APPLE)
51   add_definitions("-D_DARWIN")
52elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
53   add_definitions("-D_LINUX")
54endif()
Note: See TracBrowser for help on using the repository browser.