1 | ###
|
---|
2 | # CMakeLists.txt for build with casa
|
---|
3 | ###
|
---|
4 |
|
---|
5 |
|
---|
6 | # environment dependent settings
|
---|
7 | if( APPLE )
|
---|
8 | if ( CMAKE_SYSTEM MATCHES ^Darwin-1[0-4] )
|
---|
9 | message( STATUS "This is OS X" )
|
---|
10 | if ( CMAKE_SYSTEM MATCHES ^Darwin-1[34] )
|
---|
11 | set( arch darwin )
|
---|
12 | endif()
|
---|
13 | if ( NOT arch )
|
---|
14 | set( arch darwin64 )
|
---|
15 | endif()
|
---|
16 | if( NOT archflag )
|
---|
17 | if( EXISTS /opt/casa/01 )
|
---|
18 | set( archflag x86_64 )
|
---|
19 | elseif( EXISTS /opt/casa/darwin12 )
|
---|
20 | set( archflag x86_64 )
|
---|
21 | elseif( EXISTS /opt/casa/darwin11 )
|
---|
22 | set( archflag x86_64 )
|
---|
23 | elseif( EXISTS /opt/casa/darwin10-64b )
|
---|
24 | set( archflag x86_64 )
|
---|
25 | elseif( EXISTS /opt/casa/core2-apple-darwin10 )
|
---|
26 | set( archflag i386 )
|
---|
27 | elseif( EXISTS /opt/casa/01 )
|
---|
28 | set( archflag x86_64 )
|
---|
29 | else()
|
---|
30 | set( archflag x86_64 )
|
---|
31 | endif()
|
---|
32 | endif()
|
---|
33 | if( archflag STREQUAL x86_64 )
|
---|
34 | if( CMAKE_SYSTEM MATCHES ^Darwin-1[2-4] )
|
---|
35 | if ( EXISTS /opt/casa/01 )
|
---|
36 | set( casa_packages /opt/casa/01 )
|
---|
37 | else()
|
---|
38 | set( casa_packages /opt/local )
|
---|
39 | endif()
|
---|
40 | elseif( CMAKE_SYSTEM MATCHES ^Darwin-11 )
|
---|
41 | if ( EXISTS /opt/casa/01 )
|
---|
42 | set( casa_packages /opt/casa/01 )
|
---|
43 | else()
|
---|
44 | set( casa_packages /opt/casa/darwin11 )
|
---|
45 | endif()
|
---|
46 | else()
|
---|
47 | set( casa_packages /opt/casa/darwin10-64b )
|
---|
48 | endif()
|
---|
49 | else()
|
---|
50 | set( casa_packages /opt/casa/core2-apple-darwin10 )
|
---|
51 | endif()
|
---|
52 | elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 )
|
---|
53 | if ( NOT arch )
|
---|
54 | set( arch darwin )
|
---|
55 | endif()
|
---|
56 | set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party )
|
---|
57 | endif()
|
---|
58 | elseif( CMAKE_SYSTEM_NAME STREQUAL Linux )
|
---|
59 | if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 )
|
---|
60 | if ( EXISTS /usr/lib64/casa/01 )
|
---|
61 | set( casa_packages /usr/lib64/casa/01 )
|
---|
62 | else( )
|
---|
63 | set( casa_packages /usr/lib64/casapy )
|
---|
64 | endif( )
|
---|
65 | if( NOT arch )
|
---|
66 | set( arch linux_64b )
|
---|
67 | endif()
|
---|
68 | else()
|
---|
69 | set( casa_packages /usr/lib/casapy )
|
---|
70 | if( NOT arch )
|
---|
71 | set( arch linux_gnu )
|
---|
72 | endif()
|
---|
73 | endif()
|
---|
74 | endif()
|
---|
75 | message( STATUS "arch = " ${arch} )
|
---|
76 | message( STATUS "casa_packages = " ${casa_packages} )
|
---|
77 |
|
---|
78 | # install directory
|
---|
79 | #
|
---|
80 | # The layout of the source+install directory trees
|
---|
81 | # is rather hard-coded in much source code. However,
|
---|
82 | # with care CASA can be built and installed elsewhere...
|
---|
83 | #
|
---|
84 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
85 | # the regular expression means '../'
|
---|
86 | # [^ ] Matches any character(s) not inside the brackets
|
---|
87 | # + Matches preceding pattern one or more times
|
---|
88 | # ? Matches preceding pattern zero or once only
|
---|
89 | # $ Mathces at end of a line
|
---|
90 | string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
|
---|
91 | set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
|
---|
92 | ELSE()
|
---|
93 | set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
|
---|
94 | ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
---|
95 |
|
---|
96 | message( STATUS "casaroot = " ${casaroot} )
|
---|
97 |
|
---|
98 | # modules
|
---|
99 | IF ( NOT DEFINED CASA_CODE_PATH )
|
---|
100 | IF ( EXISTS ${casaroot}/code/install )
|
---|
101 | set( CASA_CODE_PATH ${casaroot}/code )
|
---|
102 | ELSE()
|
---|
103 | set( CASA_CODE_PATH ${CMAKE_SOURCE_DIR}/../code )
|
---|
104 | ENDIF()
|
---|
105 | ENDIF()
|
---|
106 | message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
|
---|
107 | set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
|
---|
108 | message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
|
---|
109 |
|
---|
110 | include( config )
|
---|
111 | include( CASA )
|
---|
112 |
|
---|
113 | #
|
---|
114 | # casacore
|
---|
115 | #
|
---|
116 | set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
|
---|
117 |
|
---|
118 | SET(NO_SOVERSION FALSE CACHE BOOL "do not add version information to shared libraries")
|
---|
119 | if( NOT NO_SOVERSION )
|
---|
120 | set( epochdelta 1385403204 )
|
---|
121 | if ( EXISTS ${CMAKE_INSTALL_PREFIX}/${arch}/casa_sover.txt )
|
---|
122 | execute_process( COMMAND perl -e "while (<>) { chomp and print if (! m/^\#/ ) }" ${CMAKE_INSTALL_PREFIX}/${arch}/casa_sover.txt
|
---|
123 | OUTPUT_VARIABLE __asap_soversion )
|
---|
124 | elseif( EXISTS ${CMAKE_INSTALL_PREFIX}/casa_sover.txt )
|
---|
125 | execute_process( COMMAND perl -e "while (<>) { chomp and print if (! m/^#/ ) }" ${CMAKE_INSTALL_PREFIX}/casa_sover.txt
|
---|
126 | OUTPUT_VARIABLE __asap_soversion )
|
---|
127 | else( )
|
---|
128 | execute_process( COMMAND perl -e "$t=time( )-${epochdelta};$z=$t & 0xff; $y=($t>>8)&0xff; $x=($t>>16)&0xffff; print \"$x.$y.$z\""
|
---|
129 | OUTPUT_VARIABLE __asap_soversion )
|
---|
130 | endif( )
|
---|
131 | set(asap_soversion ${__asap_soversion} CACHE STRING "version for shared objects")
|
---|
132 | message( STATUS "Shared object version number ${asap_soversion}" )
|
---|
133 | else( )
|
---|
134 | message( STATUS "User disabled shared library versioning" )
|
---|
135 | endif( )
|
---|
136 |
|
---|
137 | #
|
---|
138 | # Boost
|
---|
139 | #
|
---|
140 | if( NOT BOOST_ROOT )
|
---|
141 | set( BOOST_ROOT ${casa_packages} )
|
---|
142 | endif()
|
---|
143 |
|
---|
144 |
|
---|
145 | #
|
---|
146 | # wcslib
|
---|
147 | #
|
---|
148 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
|
---|
149 |
|
---|
150 |
|
---|
151 | #
|
---|
152 | # CASA (only alma/ASDM)
|
---|
153 | #
|
---|
154 | #find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
|
---|
155 | # HINTS ${LIBXML2_ROOT_DIR}/include
|
---|
156 | # PATH_SUFFIXES libxml2 )
|
---|
157 | #if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
|
---|
158 | # message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
|
---|
159 | #endif()
|
---|
160 | #message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
|
---|
161 | #find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
162 | # HINTS ${LIBXML2_ROOT_DIR}
|
---|
163 | # PATHS /usr
|
---|
164 | # PATH_SUFFIXES lib64 lib lib/x86_64-linux-gnu)
|
---|
165 | #find_path( LIBXML2_LIBRARY libxml2.so )
|
---|
166 | #if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
|
---|
167 | # message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
|
---|
168 | #endif()
|
---|
169 | #message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
|
---|
170 |
|
---|
171 | #set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH} )
|
---|
172 | #if ( EXISTS ${CASA_CODE_PATH}/include/alma )
|
---|
173 | # set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH}/include )
|
---|
174 | #endif()
|
---|
175 | #set( ASDM_INCLUDE_DIR_OLD ${ASDM_INCLUDE_ROOT}/alma/ASDM
|
---|
176 | # ${ASDM_INCLUDE_ROOT}/alma/Enumerations
|
---|
177 | # ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
|
---|
178 | # ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
|
---|
179 | # ${LIBXML2_INCLUDE_DIR} )
|
---|
180 | #set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
181 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
182 | #set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma_v3/ASDM
|
---|
183 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumerations
|
---|
184 | # ${ASDM_INCLUDE_ROOT}/alma_v3/ASDMBinaries
|
---|
185 | # ${ASDM_INCLUDE_ROOT}/alma_v3/Enumtcl
|
---|
186 | # ${LIBXML2_INCLUDE_DIR} )
|
---|
187 | #set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
188 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
189 | #set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma/ASDM
|
---|
190 | # ${ASDM_INCLUDE_ROOT}/alma/Enumerations
|
---|
191 | # ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
|
---|
192 | # ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
|
---|
193 | # ${LIBXML2_INCLUDE_DIR} )
|
---|
194 | #if ( NOT ALMA_LIB_PATH )
|
---|
195 | # set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
|
---|
196 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
197 | #else( )
|
---|
198 | # set( ASDM_LIBRARY ${ALMA_LIB_PATH}
|
---|
199 | # ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
200 | #endif( )
|
---|
201 | #message( STATUS "ASDM_LIBRARY = " ${ASDM_LIBRARY} )
|
---|
202 | #add_definitions( -DWITHOUT_ACS )
|
---|
203 |
|
---|
204 | #set( COMPONENTS_INCLUDE_ROOT ${CASA_CODE_PATH} )
|
---|
205 | #if ( EXISTS ${CASA_CODE_PATH}/include/components )
|
---|
206 | # set( COMPONENTS_INCLUDE_ROOT ${CASA_CODE_PATH}/include )
|
---|
207 | #endif()
|
---|
208 | #set( COMPONENTS_INCLUDE_DIR ${COMPONENTS_INCLUDE_ROOT}/components/SpectralComponents )
|
---|
209 | #if ( NOT COMPONENTS_LIB_PATH )
|
---|
210 | # set( COMPONENTS_LIBRARY ${casaroot}/${arch}/lib/libcomponents${CMAKE_SHARED_LIBRARY_SUFFIX} )
|
---|
211 | #else( )
|
---|
212 | # set( COMPONENTS_LIBRARY ${COMPONENTS_LIB_PATH} )
|
---|
213 | #endif( )
|
---|
214 |
|
---|
215 | #
|
---|
216 | # subdirectories
|
---|
217 | # ASAP2TO3 asap2to3 apps
|
---|
218 | # PYRAPLIB libpyrap.so external/libpyrap
|
---|
219 | # ATNFLIB libatnf.so external-alma/atnf
|
---|
220 | # ASAPLIB _asap.so src
|
---|
221 | # python modules python
|
---|
222 | # shared files share
|
---|
223 | #
|
---|
224 | macro( asap_add_subdirectory )
|
---|
225 | add_subdirectory( apps )
|
---|
226 | # add_subdirectory( external/libpyrap )
|
---|
227 | add_subdirectory( external-alma/atnf )
|
---|
228 | add_subdirectory( src )
|
---|
229 | add_subdirectory( python )
|
---|
230 | add_subdirectory( share )
|
---|
231 | # add_subdirectory( external-alma/asdm2ASAP )
|
---|
232 | # add_subdirectory( external-alma/oldasdm2ASAP )
|
---|
233 | endmacro( asap_add_subdirectory )
|
---|
234 |
|
---|