[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 | |
---|
| 98 | |
---|
| 99 | # |
---|
| 100 | # Boost |
---|
| 101 | # |
---|
| 102 | if( NOT BOOST_ROOT ) |
---|
| 103 | set( BOOST_ROOT ${casa_packages} ) |
---|
| 104 | endif() |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | # |
---|
| 108 | # wcslib |
---|
| 109 | # |
---|
[1970] | 110 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" ) |
---|
[1968] | 111 | |
---|
| 112 | |
---|
| 113 | # |
---|
[2210] | 114 | # CASA (only alma/ASDM) |
---|
| 115 | # |
---|
| 116 | find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h |
---|
| 117 | PATH_SUFFIXES libxml2 ) |
---|
| 118 | if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" ) |
---|
| 119 | message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" ) |
---|
| 120 | endif() |
---|
| 121 | message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} ) |
---|
[2236] | 122 | find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} |
---|
[2210] | 123 | PATHS /usr |
---|
| 124 | PATH_SUFFIXES lib64 lib ) |
---|
| 125 | #find_path( LIBXML2_LIBRARY libxml2.so ) |
---|
| 126 | if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" ) |
---|
[2236] | 127 | message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" ) |
---|
[2210] | 128 | endif() |
---|
| 129 | message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} ) |
---|
[2578] | 130 | |
---|
| 131 | set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH} ) |
---|
| 132 | if ( EXISTS ${CASA_CODE_PATH}/include/alma ) |
---|
| 133 | set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH}/include ) |
---|
| 134 | endif() |
---|
| 135 | #set( ASDM_INCLUDE_DIR_OLD ${ASDM_INCLUDE_ROOT}/alma/ASDM |
---|
| 136 | # ${ASDM_INCLUDE_ROOT}/alma/Enumerations |
---|
| 137 | # ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries |
---|
| 138 | # ${ASDM_INCLUDE_ROOT}/alma/Enumtcl |
---|
[2417] | 139 | # ${LIBXML2_INCLUDE_DIR} ) |
---|
| 140 | #set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX} |
---|
| 141 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} ) |
---|
[2578] | 142 | #set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma_v3/ASDM |
---|
| 143 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumerations |
---|
| 144 | # ${ASDM_INCLUDE_ROOT}/alma_v3/ASDMBinaries |
---|
| 145 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumtcl |
---|
[2417] | 146 | # ${LIBXML2_INCLUDE_DIR} ) |
---|
| 147 | #set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX} |
---|
| 148 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} ) |
---|
[2578] | 149 | set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma/ASDM |
---|
| 150 | ${ASDM_INCLUDE_ROOT}/alma/Enumerations |
---|
| 151 | ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries |
---|
| 152 | ${ASDM_INCLUDE_ROOT}/alma/Enumtcl |
---|
[2210] | 153 | ${LIBXML2_INCLUDE_DIR} ) |
---|
[2558] | 154 | if ( NOT ALMA_LIB_PATH ) |
---|
| 155 | set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX} |
---|
| 156 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} ) |
---|
| 157 | else( ) |
---|
| 158 | set( ASDM_LIBRARY ${ALMA_LIB_PATH} |
---|
| 159 | ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} ) |
---|
| 160 | endif( ) |
---|
| 161 | message( STATUS "ASDM_LIBRARY = " ${ASDM_LIBRARY} ) |
---|
[2210] | 162 | add_definitions( -DWITHOUT_ACS ) |
---|
| 163 | |
---|
| 164 | # |
---|
[1968] | 165 | # subdirectories |
---|
| 166 | # ASAP2TO3 asap2to3 apps |
---|
| 167 | # PYRAPLIB libpyrap.so external/libpyrap |
---|
| 168 | # ATNFLIB libatnf.so external-alma/atnf |
---|
| 169 | # ASAPLIB _asap.so src |
---|
| 170 | # python modules python |
---|
| 171 | # shared files share |
---|
| 172 | # |
---|
| 173 | macro( asap_add_subdirectory ) |
---|
| 174 | add_subdirectory( apps ) |
---|
| 175 | add_subdirectory( external/libpyrap ) |
---|
| 176 | add_subdirectory( external-alma/atnf ) |
---|
| 177 | add_subdirectory( src ) |
---|
| 178 | add_subdirectory( python ) |
---|
| 179 | add_subdirectory( share ) |
---|
[2273] | 180 | add_subdirectory( external-alma/asdm2ASAP ) |
---|
[2417] | 181 | # add_subdirectory( external-alma/oldasdm2ASAP ) |
---|
[1968] | 182 | endmacro( asap_add_subdirectory ) |
---|
| 183 | |
---|