[1968] | 1 | ###
|
---|
| 2 | # CMakeLists.txt for build with casa
|
---|
| 3 | ###
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | # environment dependent settings
|
---|
| 7 | if( APPLE )
|
---|
[2400] | 8 | if( CMAKE_SYSTEM MATCHES ^Darwin-10 OR
|
---|
| 9 | CMAKE_SYSTEM MATCHES ^Darwin-11 )
|
---|
[2399] | 10 | if ( NOT arch )
|
---|
| 11 | set( arch darwin64 )
|
---|
| 12 | endif()
|
---|
[1968] | 13 | if( NOT archflag )
|
---|
[2400] | 14 | if( EXISTS /opt/casa/darwin11 )
|
---|
[1968] | 15 | set( archflag x86_64 )
|
---|
[2400] | 16 | elseif( EXISTS /opt/casa/darwin10-64b )
|
---|
| 17 | set( archflag x86_64 )
|
---|
[1968] | 18 | elseif( EXISTS /opt/casa/core2-apple-darwin10 )
|
---|
| 19 | set( archflag i386 )
|
---|
| 20 | else()
|
---|
| 21 | set( archflag x86_64 )
|
---|
| 22 | endif()
|
---|
| 23 | endif()
|
---|
| 24 | if( archflag STREQUAL x86_64 )
|
---|
[2400] | 25 | if( CMAKE_SYSTEM MATCHES ^Darwin-11 )
|
---|
| 26 | set( casa_packages /opt/casa/darwin11 )
|
---|
| 27 | else()
|
---|
| 28 | set( casa_packages /opt/casa/darwin10-64b )
|
---|
| 29 | endif()
|
---|
[1968] | 30 | else()
|
---|
| 31 | set( casa_packages /opt/casa/core2-apple-darwin10 )
|
---|
| 32 | endif()
|
---|
| 33 | elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 )
|
---|
[2399] | 34 | if ( NOT arch )
|
---|
| 35 | set( arch darwin )
|
---|
| 36 | endif()
|
---|
[1968] | 37 | set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party )
|
---|
| 38 | endif()
|
---|
| 39 | elseif( CMAKE_SYSTEM_NAME STREQUAL Linux )
|
---|
| 40 | if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 )
|
---|
| 41 | set( casa_packages /usr/lib64/casapy )
|
---|
| 42 | if( NOT arch )
|
---|
| 43 | set( arch linux_64b )
|
---|
| 44 | endif()
|
---|
| 45 | else()
|
---|
| 46 | set( casa_packages /usr/lib/casapy )
|
---|
| 47 | if( NOT arch )
|
---|
| 48 | set( arch linux_gnu )
|
---|
| 49 | endif()
|
---|
| 50 | endif()
|
---|
| 51 | endif()
|
---|
| 52 | message( STATUS "arch = " ${arch} )
|
---|
| 53 |
|
---|
[1991] | 54 | # install directory
|
---|
| 55 | #
|
---|
| 56 | # The layout of the source+install directory trees
|
---|
| 57 | # is rather hard-coded in much source code. However,
|
---|
| 58 | # with care CASA can be built and installed elsewhere...
|
---|
| 59 | #
|
---|
| 60 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
| 61 | # the regular expression means '../'
|
---|
| 62 | # [^ ] Matches any character(s) not inside the brackets
|
---|
| 63 | # + Matches preceding pattern one or more times
|
---|
| 64 | # ? Matches preceding pattern zero or once only
|
---|
| 65 | # $ Mathces at end of a line
|
---|
| 66 | string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
|
---|
[2092] | 67 | set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
|
---|
[1991] | 68 | ELSE()
|
---|
[2092] | 69 | set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
|
---|
[1991] | 70 | ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
[1968] | 71 |
|
---|
[1991] | 72 | message( STATUS "casaroot = " ${casaroot} )
|
---|
[1968] | 73 |
|
---|
[1991] | 74 | # modules
|
---|
[2183] | 75 | IF ( NOT DEFINED CASA_CODE_PATH )
|
---|
| 76 | IF ( EXISTS ${casaroot}/code/install )
|
---|
| 77 | set( CASA_CODE_PATH ${casaroot}/code )
|
---|
| 78 | ELSE()
|
---|
| 79 | set( CASA_CODE_PATH ${CMAKE_SOURCE_DIR}/../code )
|
---|
| 80 | ENDIF()
|
---|
[1991] | 81 | ENDIF()
|
---|
[2183] | 82 | message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
|
---|
| 83 | set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
|
---|
[2181] | 84 | message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
|
---|
[1991] | 85 |
|
---|
| 86 | include( config )
|
---|
| 87 | include( CASA )
|
---|
| 88 |
|
---|
[1968] | 89 | #
|
---|
| 90 | # casacore
|
---|
| 91 | #
|
---|
[1976] | 92 | set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
|
---|
[1968] | 93 |
|
---|
| 94 |
|
---|
| 95 | #
|
---|
| 96 | # Boost
|
---|
| 97 | #
|
---|
| 98 | if( NOT BOOST_ROOT )
|
---|
| 99 | set( BOOST_ROOT ${casa_packages} )
|
---|
| 100 | endif()
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | #
|
---|
| 104 | # wcslib
|
---|
| 105 | #
|
---|
[1970] | 106 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
|
---|
[1968] | 107 |
|
---|
| 108 |
|
---|
| 109 | #
|
---|
[2210] | 110 | # CASA (only alma/ASDM)
|
---|
| 111 | #
|
---|
| 112 | find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
|
---|
| 113 | PATH_SUFFIXES libxml2 )
|
---|
| 114 | if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
|
---|
| 115 | message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
|
---|
| 116 | endif()
|
---|
| 117 | message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
|
---|
[2236] | 118 | find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
[2210] | 119 | PATHS /usr
|
---|
| 120 | PATH_SUFFIXES lib64 lib )
|
---|
| 121 | #find_path( LIBXML2_LIBRARY libxml2.so )
|
---|
| 122 | if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
|
---|
[2236] | 123 | message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
|
---|
[2210] | 124 | endif()
|
---|
| 125 | message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
|
---|
[2273] | 126 | set( ASDM_INCLUDE_DIR_OLD ${CASA_CODE_PATH}/alma/implement/ASDM
|
---|
| 127 | ${CASA_CODE_PATH}/alma/implement/Enumerations
|
---|
| 128 | ${CASA_CODE_PATH}/alma/implement/ASDMBinaries
|
---|
| 129 | ${CASA_CODE_PATH}/alma/implement/Enumtcl
|
---|
| 130 | ${LIBXML2_INCLUDE_DIR} )
|
---|
| 131 | set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
| 132 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
| 133 | set( ASDM_INCLUDE_DIR ${CASA_CODE_PATH}/alma_v3/implement/ASDM
|
---|
| 134 | ${CASA_CODE_PATH}/alma_v3/implement/Enumerations
|
---|
| 135 | ${CASA_CODE_PATH}/alma_v3/implement/ASDMBinaries
|
---|
| 136 | ${CASA_CODE_PATH}/alma_v3/implement/Enumtcl
|
---|
[2210] | 137 | ${LIBXML2_INCLUDE_DIR} )
|
---|
[2273] | 138 | set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
| 139 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
[2210] | 140 | add_definitions( -DWITHOUT_ACS )
|
---|
| 141 |
|
---|
| 142 | #
|
---|
[1968] | 143 | # subdirectories
|
---|
| 144 | # ASAP2TO3 asap2to3 apps
|
---|
| 145 | # PYRAPLIB libpyrap.so external/libpyrap
|
---|
| 146 | # ATNFLIB libatnf.so external-alma/atnf
|
---|
| 147 | # ASAPLIB _asap.so src
|
---|
| 148 | # python modules python
|
---|
| 149 | # shared files share
|
---|
| 150 | #
|
---|
| 151 | macro( asap_add_subdirectory )
|
---|
| 152 | add_subdirectory( apps )
|
---|
| 153 | add_subdirectory( external/libpyrap )
|
---|
| 154 | add_subdirectory( external-alma/atnf )
|
---|
| 155 | add_subdirectory( src )
|
---|
| 156 | add_subdirectory( python )
|
---|
| 157 | add_subdirectory( share )
|
---|
[2273] | 158 | add_subdirectory( external-alma/asdm2ASAP )
|
---|
| 159 | add_subdirectory( external-alma/oldasdm2ASAP )
|
---|
[1968] | 160 | endmacro( asap_add_subdirectory )
|
---|
| 161 |
|
---|