source: trunk/cmake/withcasa.cmake@ 2486

Last change on this file since 2486 was 2417, checked in by Takeshi Nakazato, 13 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Changes along with Michel's code re-organization on alma modules.
Currently, oldasdm2ASAP will not be built since its counterpart
(libalma module) is overwritten. Furthermore, asdm2ASAP will be linked
to libalma module, not to libalma_v3 module since libalma_v3 is
renamed as libalma.


File size: 5.6 KB
RevLine 
[1968]1###
2# CMakeLists.txt for build with casa
3###
4
5
6# environment dependent settings
7if( 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()
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
[1991]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} )
[2092]67 set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
[1991]68ELSE()
[2092]69 set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
[1991]70ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
[1968]71
[1991]72message( STATUS "casaroot = " ${casaroot} )
[1968]73
[1991]74# modules
[2183]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()
[1991]81ENDIF()
[2183]82message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
83set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
[2181]84message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
[1991]85
86include( config )
87include( CASA )
88
[1968]89#
90# casacore
91#
[1976]92set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
[1968]93
94
95#
96# Boost
97#
98if( NOT BOOST_ROOT )
99 set( BOOST_ROOT ${casa_packages} )
100endif()
101
102
103#
104# wcslib
105#
[1970]106set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
[1968]107
108
109#
[2210]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} )
[2236]118find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
[2210]119 PATHS /usr
120 PATH_SUFFIXES lib64 lib )
121#find_path( LIBXML2_LIBRARY libxml2.so )
122if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
[2236]123 message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
[2210]124endif()
125message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
[2417]126#set( 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} )
131#set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
132# ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
133#set( 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} )
138#set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
139# ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
140set( ASDM_INCLUDE_DIR ${CASA_CODE_PATH}/alma/implement/ASDM
141 ${CASA_CODE_PATH}/alma/implement/Enumerations
142 ${CASA_CODE_PATH}/alma/implement/ASDMBinaries
143 ${CASA_CODE_PATH}/alma/implement/Enumtcl
[2210]144 ${LIBXML2_INCLUDE_DIR} )
[2417]145set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
[2273]146 ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
[2210]147add_definitions( -DWITHOUT_ACS )
148
149#
[1968]150# subdirectories
151# ASAP2TO3 asap2to3 apps
152# PYRAPLIB libpyrap.so external/libpyrap
153# ATNFLIB libatnf.so external-alma/atnf
154# ASAPLIB _asap.so src
155# python modules python
156# shared files share
157#
158macro( asap_add_subdirectory )
159 add_subdirectory( apps )
160 add_subdirectory( external/libpyrap )
161 add_subdirectory( external-alma/atnf )
162 add_subdirectory( src )
163 add_subdirectory( python )
164 add_subdirectory( share )
[2273]165 add_subdirectory( external-alma/asdm2ASAP )
[2417]166# add_subdirectory( external-alma/oldasdm2ASAP )
[1968]167endmacro( asap_add_subdirectory )
168
Note: See TracBrowser for help on using the repository browser.