source: PSPA/madxPSPA/cmake/setupOptions.cmake @ 447

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

import madx-5.01.00

File size: 1.8 KB
Line 
1
2# project options
3
4option( MADX_STATIC "Turn on for static linking" OFF)
5option( MADX_DEBUG "Turn on debug output" OFF)
6
7# We need to specify what kind of library suffixes we search for in case
8# for static linking:
9if(MADX_STATIC)
10    if(WIN32)
11        set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
12    elseif(APPLE)
13        set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib)
14    else()
15        set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
16    endif()
17    if(BUILD_SHARED_LIBS)
18       message(FATAL_ERROR "Cannot build shared libs with MADX_STATIC on")
19    endif()
20endif()
21
22#Mad-X specific options (arch. specific options can be added in similar manner):
23option( MADX_NTPSA "Build with NTPSA" ON)
24option( MADX_FORCE_32 "Force 32bit build" OFF )
25if(APPLE)
26 option( MADX_BUNDLE "Create bundle on OSX" OFF)
27endif()
28
29# double logic: first we set madx_online default on if sdds is found
30# then if MADX_ONLINE is on without sdds found, we throw fatal error.
31
32if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
33#include our specific folders:
34    if( MADX_FORCE_32 OR ${CMAKE_SIZEOF_VOID_P} EQUAL 4 )
35        set(SDDS_SEARCH_DIRS  ${CMAKE_SOURCE_DIR}/lib32/)
36    else()
37        set(SDDS_SEARCH_DIRS  ${CMAKE_SOURCE_DIR}/lib64/)
38    endif()
39endif()
40# normal search:
41find_package(SDDS)
42
43if(SDDS_FOUND)
44    option( MADX_ONLINE "Build with Online model" ON)
45else()
46    option( MADX_ONLINE "Build with Online model" OFF)
47endif()
48if(MADX_ONLINE AND NOT SDDS_FOUND)
49    message(FATAL_ERROR "SDDS is not found, required for the online model!")
50endif()
51
52# Default build type (defines different sets of flags)
53if(NOT CMAKE_BUILD_TYPE)
54    set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
55       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
56       FORCE)
57endif()
58
59if(MADX_NTPSA)
60    add_definitions("-D_NTPSA")
61endif()
Note: See TracBrowser for help on using the repository browser.