Changeset 1956


Ignore:
Timestamp:
12/06/10 12:09:11 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2668

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

Introduced USE_LIBCASACORE switch to enable to choose casacore libraries
to be built with ASAP (libcasacore.so or libcasa_casa.so etc.).
Default is not use libcasacore.so library.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r1954 r1956  
    9090# casacore
    9191#
    92 set( CASACORE_INCLUDE_DIR ${casaroot}/${arch}/include/casacore )
    93 
    94 set( CASACORE_LIBS casa
    95                    components
    96                    coordinates
    97                    fits
    98                    images
    99                    lattices
    100                    measures
    101                    mirlib
    102                    ms
    103                    msfits
    104                    scimath
    105                    scimath_f
    106                    tables )
    107 set( _casacore_libs "" )
    108 foreach( _a ${CASACORE_LIBS} )
    109    set( _libname libcasa_${_a}.${SO} )
    110    unset( _casacore_lib CACHE )
    111    find_library( _casacore_lib ${_libname}
    112                  PATHS ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES lib )
    113    if( NOT _casacore_lib-NOTFOUND )
    114       list( APPEND _casacore_libs casa_${_a} )
    115    endif()
    116 endforeach()
    117 set( CASACORE_LIBRARIES ${_casacore_libs} )
     92if( NOT USE_LIBCASACORE )
     93   # use casacore libraries
     94   set( _includename aipsdef.h )
     95   find_path( CASACORE_INCPATH ${_includename}
     96              HINTS ${casaroot}/${arch}/include/
     97              PATH_SUFFIXES casacore/casa )
     98   if( CASACORE_INCPATH STREQUAL CASACORE_INCPATH-NOTFOUND )
     99     message( FATAL_ERROR "${_includename} could not be found. Please check!" )
     100   else()
     101      string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} ) 
     102   endif()
     103   set( CASACORE_LIBS casa
     104                      components
     105                      coordinates
     106                      fits
     107                      images
     108                      lattices
     109                      measures
     110                      mirlib
     111                      ms
     112                      msfits
     113                      scimath
     114                      scimath_f
     115                      tables )
     116   set( _casacore_libs "" )
     117   foreach( _a ${CASACORE_LIBS} )
     118      set( _libname libcasa_${_a}.${SO} )
     119      unset( _casacore_lib CACHE )
     120      find_library( _casacore_lib ${_libname}
     121                    PATHS ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES lib )
     122      if( NOT _casacore_lib-NOTFOUND )
     123         list( APPEND _casacore_libs casa_${_a} )
     124      endif()
     125   endforeach()
     126   set( CASACORE_LIBRARIES ${_casacore_libs} )
     127else()
     128   # use libcasacore
     129   set( _libname libcasacore.${SO} )
     130   find_library( CASACORE_LIBRARIES ${_libname} )
     131   if( CASACORE_LIBRARIES STREQUAL CASACORE_LIBRARIES-NOTFOUND )
     132      message( FATAL_ERROR "${_libname} could not be found. Please check!" )
     133   endif()
     134   set( _includename aipsdef.h )
     135   find_path( CASACORE_INCPATH ${_includename}
     136              PATH_SUFFIXES casacore/casa )
     137   if( CASACORE_INCPATH STREQUAL CASACORE_INCPATH-NOTFOUND )
     138     message( FATAL_ERROR "${_includename} could not be found. Please check!" )
     139   else()
     140      string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} )
     141   endif()
     142endif()
    118143message( STATUS "CASACORE_LIBRARIES = " ${CASACORE_LIBRARIES} )
     144message( STATUS "CASACORE_INCLUDE_DIR = " ${CASACORE_INCLUDE_DIR} )
    119145
    120146#
Note: See TracChangeset for help on using the changeset viewer.