[1968] | 1 | ### |
---|
| 2 | # CMakeLists.txt for build with casa |
---|
| 3 | ### |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | # environment dependent settings |
---|
| 7 | if( APPLE ) |
---|
| 8 | if( NOT arch ) |
---|
| 9 | set( arch darwin ) |
---|
| 10 | endif() |
---|
| 11 | if( CMAKE_SYSTEM MATCHES ^Darwin-10 ) |
---|
| 12 | if( NOT archflag ) |
---|
| 13 | if( EXISTS /opt/casa/darwin10-64b ) |
---|
| 14 | set( archflag x86_64 ) |
---|
| 15 | elseif( EXISTS /opt/casa/core2-apple-darwin10 ) |
---|
| 16 | set( archflag i386 ) |
---|
| 17 | else() |
---|
| 18 | set( archflag x86_64 ) |
---|
| 19 | endif() |
---|
| 20 | endif() |
---|
| 21 | if( archflag STREQUAL x86_64 ) |
---|
| 22 | set( casa_packages /opt/casa/darwin10-64b ) |
---|
| 23 | else() |
---|
| 24 | set( casa_packages /opt/casa/core2-apple-darwin10 ) |
---|
| 25 | endif() |
---|
| 26 | elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 ) |
---|
| 27 | set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party ) |
---|
| 28 | endif() |
---|
| 29 | elseif( CMAKE_SYSTEM_NAME STREQUAL Linux ) |
---|
| 30 | if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 ) |
---|
| 31 | set( casa_packages /usr/lib64/casapy ) |
---|
| 32 | if( NOT arch ) |
---|
| 33 | set( arch linux_64b ) |
---|
| 34 | endif() |
---|
| 35 | else() |
---|
| 36 | set( casa_packages /usr/lib/casapy ) |
---|
| 37 | if( NOT arch ) |
---|
| 38 | set( arch linux_gnu ) |
---|
| 39 | endif() |
---|
| 40 | endif() |
---|
| 41 | endif() |
---|
| 42 | message( STATUS "arch = " ${arch} ) |
---|
| 43 | |
---|
[1991] | 44 | # install directory |
---|
| 45 | # |
---|
| 46 | # The layout of the source+install directory trees |
---|
| 47 | # is rather hard-coded in much source code. However, |
---|
| 48 | # with care CASA can be built and installed elsewhere... |
---|
| 49 | # |
---|
| 50 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
---|
| 51 | # the regular expression means '../' |
---|
| 52 | # [^ ] Matches any character(s) not inside the brackets |
---|
| 53 | # + Matches preceding pattern one or more times |
---|
| 54 | # ? Matches preceding pattern zero or once only |
---|
| 55 | # $ Mathces at end of a line |
---|
| 56 | string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} ) |
---|
| 57 | set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} ) |
---|
| 58 | ELSE() |
---|
| 59 | set( casaroot ${CMAKE_INSTALL_PREFIX}/.. ) |
---|
| 60 | ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
---|
[1968] | 61 | |
---|
[1991] | 62 | message( STATUS "casaroot = " ${casaroot} ) |
---|
[1968] | 63 | |
---|
[1991] | 64 | # modules |
---|
| 65 | IF ( EXISTS ${casaroot}/code/install ) |
---|
| 66 | set( CMAKE_MODULE_PATH ${casaroot}/code/install ) |
---|
| 67 | ELSE() |
---|
| 68 | set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../code/install ) |
---|
| 69 | ENDIF() |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | include( config ) |
---|
| 73 | include( CASA ) |
---|
| 74 | |
---|
[1968] | 75 | # |
---|
| 76 | # casacore |
---|
| 77 | # |
---|
[1976] | 78 | set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" ) |
---|
[1968] | 79 | |
---|
| 80 | |
---|
| 81 | # |
---|
| 82 | # Boost |
---|
| 83 | # |
---|
| 84 | if( NOT BOOST_ROOT ) |
---|
| 85 | set( BOOST_ROOT ${casa_packages} ) |
---|
| 86 | endif() |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | # |
---|
| 90 | # wcslib |
---|
| 91 | # |
---|
[1970] | 92 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" ) |
---|
[1968] | 93 | |
---|
| 94 | |
---|
| 95 | # |
---|
| 96 | # subdirectories |
---|
| 97 | # ASAP2TO3 asap2to3 apps |
---|
| 98 | # PYRAPLIB libpyrap.so external/libpyrap |
---|
| 99 | # ATNFLIB libatnf.so external-alma/atnf |
---|
| 100 | # ASAPLIB _asap.so src |
---|
| 101 | # python modules python |
---|
| 102 | # shared files share |
---|
| 103 | # |
---|
| 104 | macro( asap_add_subdirectory ) |
---|
| 105 | add_subdirectory( apps ) |
---|
| 106 | add_subdirectory( external/libpyrap ) |
---|
| 107 | add_subdirectory( external-alma/atnf ) |
---|
| 108 | add_subdirectory( src ) |
---|
| 109 | add_subdirectory( python ) |
---|
| 110 | add_subdirectory( share ) |
---|
| 111 | endmacro( asap_add_subdirectory ) |
---|
| 112 | |
---|