source: trunk/cmake/withcasa.cmake @ 2399

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

New Development: No

JIRA Issue: Yes CAS-3665

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...

CMakeLists.txt is updated mainly for Mac.

  • library name for asap library is still _asap.so (not .dylib)
  • architecture name is always 'darwin64' when OS version is 10.6 or later
  • make symbolic link to $CASAROOT/$CASAARCH/python/2.6/asap/_asap.so and place it to $CASAROOT/$CASAARCH/lib
File size: 5.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 )
9      if ( NOT arch )
10         set( arch darwin64 )
11      endif()
12      if( NOT archflag )
13         if( EXISTS /opt/casa/darwin10-64b )
14            set( archflag x86_64 )
15         elseif( EXISTS /opt/casa/core2-apple-darwin10 )
16            set( archflag i386 )
17         else()
18            set( archflag x86_64 )
19         endif()
20      endif()
21      if( archflag STREQUAL x86_64 )
22         set( casa_packages /opt/casa/darwin10-64b )
23      else()
24         set( casa_packages /opt/casa/core2-apple-darwin10 )
25      endif()
26   elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 )
27      if ( NOT arch )
28         set( arch darwin )
29      endif()
30      set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party )
31   endif()         
32elseif( CMAKE_SYSTEM_NAME STREQUAL Linux )
33   if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 )
34      set( casa_packages /usr/lib64/casapy )
35      if( NOT arch )
36         set( arch linux_64b )
37      endif()
38   else()
39      set( casa_packages /usr/lib/casapy )
40      if( NOT arch )
41         set( arch linux_gnu )
42      endif()
43   endif()
44endif()
45message( STATUS "arch = " ${arch} )
46
47# install directory
48#
49# The layout of the source+install directory trees
50# is rather hard-coded in much source code. However,
51# with care CASA can be built and installed elsewhere...
52#
53IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
54    # the regular expression means '../'
55    #  [^ ] Matches any character(s) not inside the brackets
56    #  +    Matches preceding pattern one or more times
57    #  ?    Matches preceding pattern zero or once only
58    #  $    Mathces at end of a line
59    string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} )
60    set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} CACHE PATH "casa architecture directory" FORCE )
61ELSE()
62    set( casaroot ${CMAKE_INSTALL_PREFIX}/.. CACHE PATH "casa architecture directory" FORCE )
63ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
64
65message( STATUS "casaroot = " ${casaroot} )
66
67# modules
68IF ( NOT DEFINED CASA_CODE_PATH )
69    IF ( EXISTS ${casaroot}/code/install )
70        set( CASA_CODE_PATH ${casaroot}/code )
71    ELSE()
72        set( CASA_CODE_PATH ${CMAKE_SOURCE_DIR}/../code )
73    ENDIF()
74ENDIF()
75message( STATUS "CASA_CODE_PATH = " ${CASA_CODE_PATH} )
76set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CASA_CODE_PATH}/install" )
77message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
78
79include( config )
80include( CASA )
81
82#
83# casacore
84#
85set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" )
86
87
88#
89# Boost
90#
91if( NOT BOOST_ROOT )
92   set( BOOST_ROOT ${casa_packages} )
93endif()
94
95
96#
97# wcslib
98#
99set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" )
100
101
102#
103# CASA (only alma/ASDM)
104#
105find_path( LIBXML2_INCLUDE_DIR libxml/xmlversion.h
106           PATH_SUFFIXES libxml2 )
107if( LIBXML2_INCLUDE_DIR MATCHES "NOTFOUND$" )
108   message( FATAL_ERROR "libxml/xmlversion.h could not be found. Please check!" )
109endif()
110message( STATUS "LIBXML2_INCLUDE_DIR = " ${LIBXML2_INCLUDE_DIR} )
111find_path( LIBXML2_LIBRARY libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}
112           PATHS /usr
113           PATH_SUFFIXES lib64 lib )
114#find_path( LIBXML2_LIBRARY libxml2.so )
115if ( LIBXML2_LIBRARY MATCHES "NOTFOUND$" )
116   message( FATAL_ERROR "libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} could not be found. Please check!" )
117endif()
118message( STATUS "LIBXML2_LIBRARY = " ${LIBXML2_LIBRARY} )
119set( ASDM_INCLUDE_DIR_OLD ${CASA_CODE_PATH}/alma/implement/ASDM
120                          ${CASA_CODE_PATH}/alma/implement/Enumerations
121                          ${CASA_CODE_PATH}/alma/implement/ASDMBinaries
122                          ${CASA_CODE_PATH}/alma/implement/Enumtcl
123                          ${LIBXML2_INCLUDE_DIR} )
124set( ASDM_LIBRARY_OLD ${casaroot}/${arch}/lib/libalma${CMAKE_SHARED_LIBRARY_SUFFIX}
125                      ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
126set( ASDM_INCLUDE_DIR ${CASA_CODE_PATH}/alma_v3/implement/ASDM
127                      ${CASA_CODE_PATH}/alma_v3/implement/Enumerations
128                      ${CASA_CODE_PATH}/alma_v3/implement/ASDMBinaries
129                      ${CASA_CODE_PATH}/alma_v3/implement/Enumtcl
130                      ${LIBXML2_INCLUDE_DIR} )
131set( ASDM_LIBRARY ${casaroot}/${arch}/lib/libalma_v3${CMAKE_SHARED_LIBRARY_SUFFIX}
132                  ${LIBXML2_LIBRARY}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX} )
133add_definitions( -DWITHOUT_ACS )
134
135#
136# subdirectories
137#  ASAP2TO3 asap2to3       apps
138#  PYRAPLIB libpyrap.so    external/libpyrap
139#  ATNFLIB  libatnf.so     external-alma/atnf
140#  ASAPLIB  _asap.so       src
141#  python modules          python
142#  shared files            share
143#
144macro( asap_add_subdirectory )
145   add_subdirectory( apps )
146   add_subdirectory( external/libpyrap )
147   add_subdirectory( external-alma/atnf )
148   add_subdirectory( src )
149   add_subdirectory( python )
150   add_subdirectory( share )
151   add_subdirectory( external-alma/asdm2ASAP )
152   add_subdirectory( external-alma/oldasdm2ASAP )
153endmacro( asap_add_subdirectory )
154
Note: See TracBrowser for help on using the repository browser.