source: branches/hpc34/cmake/withcasa.cmake@ 3026

Last change on this file since 3026 was 2578, checked in by Takeshi Nakazato, 12 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: build asap

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Minor change to support before and after switch to swig.

File size: 5.9 KB
Line 
1###
2# CMakeLists.txt for build with casa
3###
4
5
6# environment dependent settings
7if( APPLE )
8 if( CMAKE_SYSTEM MATCHES ^Darwin-10 OR
9 CMAKE_SYSTEM MATCHES ^Darwin-11 )
10 if ( NOT arch )
11 set( arch darwin64 )
12 endif()
13 if( NOT archflag )
14 if( EXISTS /opt/casa/darwin11 )
15 set( archflag x86_64 )
16 elseif( EXISTS /opt/casa/darwin10-64b )
17 set( archflag x86_64 )
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 )
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()
30 else()
31 set( casa_packages /opt/casa/core2-apple-darwin10 )
32 endif()
33 elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 )
34 if ( NOT arch )
35 set( arch darwin )
36 endif()
37 set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party )
38 endif()
39elseif( 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()
51endif()
52message( STATUS "arch = " ${arch} )
53
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#
60IF(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} )
67 set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
68ELSE()
69 set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
70ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
71
72message( STATUS "casaroot = " ${casaroot} )
73
74# modules
75IF ( 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()
81ENDIF()
82message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
83set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
84message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
85
86include( config )
87include( CASA )
88
89#
90# casacore
91#
92set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
93
94
95#
96# Boost
97#
98if( NOT BOOST_ROOT )
99 set( BOOST_ROOT ${casa_packages} )
100endif()
101
102
103#
104# wcslib
105#
106set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
107
108
109#
110# CASA (only alma/ASDM)
111#
112find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
113 PATH_SUFFIXES libxml2 )
114if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
115 message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
116endif()
117message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
118find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
119 PATHS /usr
120 PATH_SUFFIXES lib64 lib )
121#find_path( LIBXML2_LIBRARY libxml2.so )
122if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
123 message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
124endif()
125message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
126
127set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH} )
128if ( EXISTS ${CASA_CODE_PATH}/include/alma )
129 set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH}/include )
130endif()
131#set( ASDM_INCLUDE_DIR_OLD ${ASDM_INCLUDE_ROOT}/alma/ASDM
132# ${ASDM_INCLUDE_ROOT}/alma/Enumerations
133# ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
134# ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
135# ${LIBXML2_INCLUDE_DIR} )
136#set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
137# ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
138#set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma_v3/ASDM
139# ${ASDM_INCLUDE_ROOT}/alma_v3/Enumerations
140# ${ASDM_INCLUDE_ROOT}/alma_v3/ASDMBinaries
141# ${ASDM_INCLUDE_ROOT}/alma_v3/Enumtcl
142# ${LIBXML2_INCLUDE_DIR} )
143#set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
144# ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
145set( ASDM_INCLUDE_DIR ${ASDM_INCLUDE_ROOT}/alma/ASDM
146 ${ASDM_INCLUDE_ROOT}/alma/Enumerations
147 ${ASDM_INCLUDE_ROOT}/alma/ASDMBinaries
148 ${ASDM_INCLUDE_ROOT}/alma/Enumtcl
149 ${LIBXML2_INCLUDE_DIR} )
150if ( NOT ALMA_LIB_PATH )
151 set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
152 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
153else( )
154 set( ASDM_LIBRARY ${ALMA_LIB_PATH}
155 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
156endif( )
157message( STATUS "ASDM_LIBRARY = " ${ASDM_LIBRARY} )
158add_definitions( -DWITHOUT_ACS )
159
160#
161# subdirectories
162# ASAP2TO3 asap2to3 apps
163# PYRAPLIB libpyrap.so external/libpyrap
164# ATNFLIB libatnf.so external-alma/atnf
165# ASAPLIB _asap.so src
166# python modules python
167# shared files share
168#
169macro( asap_add_subdirectory )
170 add_subdirectory( apps )
171 add_subdirectory( external/libpyrap )
172 add_subdirectory( external-alma/atnf )
173 add_subdirectory( src )
174 add_subdirectory( python )
175 add_subdirectory( share )
176 add_subdirectory( external-alma/asdm2ASAP )
177# add_subdirectory( external-alma/oldasdm2ASAP )
178endmacro( asap_add_subdirectory )
179
Note: See TracBrowser for help on using the repository browser.