source: trunk/cmake/withcasa.cmake@ 2854

Last change on this file since 2854 was 2847, checked in by Kana Sugimoto, 11 years ago

New Development: Yes

JIRA Issue: probably

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): asap build using Cmake

Description:

Applied a patch passed from Darrell for build on new third-party library configurations of CASA.

  • support of python 2.7.5
  • searching new third-party library location when built with CASA.

These changes do NOT affect build of stand-alone ASAP.


File size: 6.0 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 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( )
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()
55endif()
56message( STATUS "arch = " ${arch} )
57
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#
64IF(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} )
71 set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
72ELSE()
73 set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
74ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
75
76message( STATUS "casaroot = " ${casaroot} )
77
78# modules
79IF ( 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()
85ENDIF()
86message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
87set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
88message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
89
90include( config )
91include( CASA )
92
93#
94# casacore
95#
96set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
97
98
99#
100# Boost
101#
102if( NOT BOOST_ROOT )
103 set( BOOST_ROOT ${casa_packages} )
104endif()
105
106
107#
108# wcslib
109#
110set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
111
112
113#
114# CASA (only alma/ASDM)
115#
116find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
117 PATH_SUFFIXES libxml2 )
118if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
119 message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
120endif()
121message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
122find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
123 PATHS /usr
124 PATH_SUFFIXES lib64 lib )
125#find_path( LIBXML2_LIBRARY libxml2.so )
126if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
127 message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
128endif()
129message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
130
131set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH} )
132if ( EXISTS ${CASA_CODE_PATH}/include/alma )
133 set( ASDM_INCLUDE_ROOT ${CASA_CODE_PATH}/include )
134endif()
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
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} )
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
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} )
149set( 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
153 ${LIBXML2_INCLUDE_DIR} )
154if ( NOT ALMA_LIB_PATH )
155 set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
156 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
157else( )
158 set( ASDM_LIBRARY ${ALMA_LIB_PATH}
159 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
160endif( )
161message( STATUS "ASDM_LIBRARY = " ${ASDM_LIBRARY} )
162add_definitions( -DWITHOUT_ACS )
163
164#
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#
173macro( 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 )
180 add_subdirectory( external-alma/asdm2ASAP )
181# add_subdirectory( external-alma/oldasdm2ASAP )
182endmacro( asap_add_subdirectory )
183
Note: See TracBrowser for help on using the repository browser.