[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 )
|
---|
[2847] | 41 | if ( EXISTS /usr/lib64/casa/01 )
|
---|
| 42 | set( casa_packages /usr/lib64/casa/01 )
|
---|
| 43 | else( )
|
---|
| 44 | set( casa_packages /usr/lib64/casapy )
|
---|
| 45 | endif( )
|
---|
[1968] | 46 | if( NOT arch )
|
---|
| 47 | set( arch linux_64b )
|
---|
| 48 | endif()
|
---|
| 49 | else()
|
---|
| 50 | set( casa_packages /usr/lib/casapy )
|
---|
| 51 | if( NOT arch )
|
---|
| 52 | set( arch linux_gnu )
|
---|
| 53 | endif()
|
---|
| 54 | endif()
|
---|
| 55 | endif()
|
---|
| 56 | message( STATUS "arch = " ${arch} )
|
---|
| 57 |
|
---|
[1991] | 58 | # install directory
|
---|
| 59 | #
|
---|
| 60 | # The layout of the source+install directory trees
|
---|
| 61 | # is rather hard-coded in much source code. However,
|
---|
| 62 | # with care CASA can be built and installed elsewhere...
|
---|
| 63 | #
|
---|
| 64 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
| 65 | # the regular expression means '../'
|
---|
| 66 | # [^ ] Matches any character(s) not inside the brackets
|
---|
| 67 | # + Matches preceding pattern one or more times
|
---|
| 68 | # ? Matches preceding pattern zero or once only
|
---|
| 69 | # $ Mathces at end of a line
|
---|
| 70 | string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
|
---|
[2092] | 71 | set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
|
---|
[1991] | 72 | ELSE()
|
---|
[2092] | 73 | set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
|
---|
[1991] | 74 | ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
[1968] | 75 |
|
---|
[1991] | 76 | message( STATUS "casaroot = " ${casaroot} )
|
---|
[1968] | 77 |
|
---|
[1991] | 78 | # modules
|
---|
[2183] | 79 | IF ( NOT DEFINED CASA_CODE_PATH )
|
---|
| 80 | IF ( EXISTS ${casaroot}/code/install )
|
---|
| 81 | set( CASA_CODE_PATH ${casaroot}/code )
|
---|
| 82 | ELSE()
|
---|
| 83 | set( CASA_CODE_PATH ${CMAKE_SOURCE_DIR}/../code )
|
---|
| 84 | ENDIF()
|
---|
[1991] | 85 | ENDIF()
|
---|
[2183] | 86 | message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
|
---|
| 87 | set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
|
---|
[2181] | 88 | message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
|
---|
[1991] | 89 |
|
---|
| 90 | include( config )
|
---|
| 91 | include( CASA )
|
---|
| 92 |
|
---|
[1968] | 93 | #
|
---|
| 94 | # casacore
|
---|
| 95 | #
|
---|
[1976] | 96 | set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
|
---|
[1968] | 97 |
|
---|
[2872] | 98 | set( epochdelta 1385403204 )
|
---|
| 99 | if ( EXISTS ${CMAKE_INSTALL_PREFIX}/${arch}/casa_sover.txt )
|
---|
| 100 | execute_process( COMMAND perl -e "while (<>) { chomp and print if (! m/^\#/ ) }" ${CMAKE_INSTALL_PREFIX}/${arch}/casa_sover.txt
|
---|
| 101 | OUTPUT_VARIABLE __asap_soversion )
|
---|
| 102 | elseif( EXISTS ${CMAKE_INSTALL_PREFIX}/casa_sover.txt )
|
---|
| 103 | execute_process( COMMAND perl -e "while (<>) { chomp and print if (! m/^#/ ) }" ${CMAKE_INSTALL_PREFIX}/casa_sover.txt
|
---|
| 104 | OUTPUT_VARIABLE __asap_soversion )
|
---|
| 105 | else( )
|
---|
| 106 | execute_process( COMMAND perl -e "$t=time( )-${epochdelta};$z=$t & 0xff; $y=($t>>8)&0xff; $x=($t>>16)&0xffff; print \"$x.$y.$z\""
|
---|
| 107 | OUTPUT_VARIABLE __asap_soversion )
|
---|
| 108 | endif( )
|
---|
| 109 | set(asap_soversion ${__asap_soversion} CACHE STRING "version for shared objects")
|
---|
| 110 | message( STATUS "shared object version number ${asap_soversion}" )
|
---|
[1968] | 111 |
|
---|
| 112 | #
|
---|
| 113 | # Boost
|
---|
| 114 | #
|
---|
| 115 | if( NOT BOOST_ROOT )
|
---|
| 116 | set( BOOST_ROOT ${casa_packages} )
|
---|
| 117 | endif()
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | #
|
---|
| 121 | # wcslib
|
---|
| 122 | #
|
---|
[1970] | 123 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
|
---|
[1968] | 124 |
|
---|
| 125 |
|
---|
| 126 | #
|
---|
[2210] | 127 | # CASA (only alma/ASDM)
|
---|
| 128 | #
|
---|
| 129 | find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
|
---|
| 130 | PATH_SUFFIXES libxml2 )
|
---|
| 131 | if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
|
---|
| 132 | message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
|
---|
| 133 | endif()
|
---|
| 134 | message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
|
---|
[2236] | 135 | find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
[2210] | 136 | PATHS /usr
|
---|
| 137 | PATH_SUFFIXES lib64 lib )
|
---|
| 138 | #find_path( LIBXML2_LIBRARY libxml2.so )
|
---|
| 139 | if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
|
---|
[2236] | 140 | message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
|
---|
[2210] | 141 | endif()
|
---|
| 142 | message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
|
---|
[2578] | 143 |
|
---|
| 144 | set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH} )
|
---|
| 145 | if ( EXISTS ${CASA_CODE_PATH}/include/alma )
|
---|
| 146 | set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH}/include )
|
---|
| 147 | endif()
|
---|
| 148 | #set( ASDM_INCLUDE_DIR_OLD ${ASDM_INCLUDE_ROOT}/alma/ASDM
|
---|
| 149 | # ${ASDM_INCLUDE_ROOT}/alma/Enumerations
|
---|
| 150 | # ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
|
---|
| 151 | # ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
|
---|
[2417] | 152 | # ${LIBXML2_INCLUDE_DIR} )
|
---|
| 153 | #set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
| 154 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
[2578] | 155 | #set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma_v3/ASDM
|
---|
| 156 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumerations
|
---|
| 157 | # ${ASDM_INCLUDE_ROOT}/alma_v3/ASDMBinaries
|
---|
| 158 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumtcl
|
---|
[2417] | 159 | # ${LIBXML2_INCLUDE_DIR} )
|
---|
| 160 | #set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
| 161 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
[2578] | 162 | set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma/ASDM
|
---|
| 163 | ${ASDM_INCLUDE_ROOT}/alma/Enumerations
|
---|
| 164 | ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
|
---|
| 165 | ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
|
---|
[2210] | 166 | ${LIBXML2_INCLUDE_DIR} )
|
---|
[2558] | 167 | if ( NOT ALMA_LIB_PATH )
|
---|
| 168 | set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
| 169 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
| 170 | else( )
|
---|
| 171 | set( ASDM_LIBRARY ${ALMA_LIB_PATH}
|
---|
| 172 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
| 173 | endif( )
|
---|
| 174 | message( STATUS "ASDM_LIBRARY = " ${ASDM_LIBRARY} )
|
---|
[2210] | 175 | add_definitions( -DWITHOUT_ACS )
|
---|
| 176 |
|
---|
| 177 | #
|
---|
[1968] | 178 | # subdirectories
|
---|
| 179 | # ASAP2TO3 asap2to3 apps
|
---|
| 180 | # PYRAPLIB libpyrap.so external/libpyrap
|
---|
| 181 | # ATNFLIB libatnf.so external-alma/atnf
|
---|
| 182 | # ASAPLIB _asap.so src
|
---|
| 183 | # python modules python
|
---|
| 184 | # shared files share
|
---|
| 185 | #
|
---|
| 186 | macro( asap_add_subdirectory )
|
---|
| 187 | add_subdirectory( apps )
|
---|
| 188 | add_subdirectory( external/libpyrap )
|
---|
| 189 | add_subdirectory( external-alma/atnf )
|
---|
| 190 | add_subdirectory( src )
|
---|
| 191 | add_subdirectory( python )
|
---|
| 192 | add_subdirectory( share )
|
---|
[2273] | 193 | add_subdirectory( external-alma/asdm2ASAP )
|
---|
[2417] | 194 | # add_subdirectory( external-alma/oldasdm2ASAP )
|
---|
[1968] | 195 | endmacro( asap_add_subdirectory )
|
---|
| 196 |
|
---|