source: branches/hpc33/cmake/withcasa.cmake@ 2582

Last change on this file since 2582 was 2400, checked in by Kana Sugimoto, 13 years ago

New Development: Yes

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: build asap

Put in Release Notes: No

Module(s): asap

Description: Added cmake definitions to build asap on OSX 10.7 Lion


File size: 5.2 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} )
126set( 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} )
131set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
132 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
133set( 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
137 ${LIBXML2_INCLUDE_DIR} )
138set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
139 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
140add_definitions( -DWITHOUT_ACS )
141
142#
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#
151macro( 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 )
158 add_subdirectory( external-alma/asdm2ASAP )
159 add_subdirectory( external-alma/oldasdm2ASAP )
160endmacro( asap_add_subdirectory )
161
Note: See TracBrowser for help on using the repository browser.