Changeset 1958 for trunk


Ignore:
Timestamp:
12/07/10 19:56:51 (14 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...

Update for Mac OS X.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r1957 r1958  
    55# minimum requirement for cmake version
    66cmake_minimum_required( VERSION 2.8 )
     7
     8# Define compiler paths on OSX 10.5. This must be done before invoking project()
     9if( APPLE )
     10    if( EXISTS            /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
     11    set( SO dylib )
     12        set( CMAKE_Fortran_COMPILER /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
     13        set( CMAKE_CXX_COMPILER     /opt/casa/core2-apple-darwin8/3rd-party/bin/g++ )
     14    elseif( EXISTS        /opt/local/bin/gfortran )
     15        set( CMAKE_Fortran_COMPILER /opt/local/bin/gfortran )
     16    elseif( EXISTS        /opt/local/bin/gfortran-mp-4.4 )
     17        set( CMAKE_Fortran_COMPILER /opt/local/bin/gfortran-mp-4.4 )
     18        if( EXISTS /opt/local/bin/g++-mp-4.4 )
     19            set( CMAKE_CXX_COMPILER /opt/local/bin/g++-mp-4.4 )
     20        endif()
     21    endif()
     22endif()
    723
    824# project name is ASAP
     
    3349
    3450# environment dependent settings
     51message( STATUS "CMAKE_SYSTEM = " ${CMAKE_SYSTEM} )
    3552if( APPLE )
    3653   set( SO dylib )
     
    3855      set( arch darwin )
    3956   endif()
    40    if( CMAKE_SYSTEM MATHCES ^Darwin-10 )
     57   if( CMAKE_SYSTEM MATCHES ^Darwin-10 )
    4158      if( NOT archflag )
    4259         if( EXISTS /opt/casa/darwin10-64b )
     
    92109set( CMAKE_CXX_FLAGS ${DEFAULT_CXX_FLAGS} )
    93110
     111# DL
     112set( DL_LIBRARIES ${CMAKE_DL_LIBS} CACHE STRING "dl libraries" FORCE )
     113if( DL_LIBRARIES STREQUAL "dl" )
     114  set( DL_LIBRARIES "-ldl" CACHE STRING "dl libraries" FORCE )
     115endif()
     116message( STATUS "DL_LIBRARIES = " ${DL_LIBRARIES} )
    94117
    95118#
     
    98121if( NOT USE_LIBCASACORE )
    99122   # use casacore libraries
    100    set( _includename aipsdef.h )
    101    find_path( CASACORE_INCPATH ${_includename}
     123   set( _includename casa/aipsdef.h )
     124   find_path( CASACORE_INCLUDE_DIR ${_includename}
    102125              HINTS ${casaroot}/${arch}/include/
    103               PATH_SUFFIXES casacore/casa )
    104    if( CASACORE_INCPATH STREQUAL CASACORE_INCPATH-NOTFOUND )
     126              PATH_SUFFIXES casacore )
     127   if( CASACORE_INCLUDE_DIR STREQUAL CASACORE_INCLUDE_DIR-NOTFOUND )
    105128     message( FATAL_ERROR "${_includename} could not be found. Please check!" )
    106    else()
    107       string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} ) 
    108129   endif()
    109130   set( CASACORE_LIBS casa
     
    127148                    PATHS ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES lib )
    128149      if( NOT _casacore_lib-NOTFOUND )
    129          list( APPEND _casacore_libs casa_${_a} )
     150         #list( APPEND _casacore_libs casa_${_a} )
     151         list( APPEND _casacore_libs ${_casacore_lib} )
    130152      endif()
    131153   endforeach()
     
    138160      message( FATAL_ERROR "${_libname} could not be found. Please check!" )
    139161   endif()
    140    set( _includename aipsdef.h )
    141    find_path( CASACORE_INCPATH ${_includename}
    142               PATH_SUFFIXES casacore/casa )
    143    if( CASACORE_INCPATH STREQUAL CASACORE_INCPATH-NOTFOUND )
     162   set( _includename casa/aipsdef.h )
     163   find_path( CASACORE_INCLUDE_DIR ${_includename}
     164              PATH_SUFFIXES casacore )
     165   if( CASACORE_INCLUDE_DIR STREQUAL CASACORE_INCLUDE_DIR-NOTFOUND )
    144166     message( FATAL_ERROR "${_includename} could not be found. Please check!" )
    145    else()
    146       string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} )
    147167   endif()
    148168endif()
     
    279299#
    280300set( _wcslib libwcs.${SO} )
     301set( _wcs_version 4.3 )
    281302find_library( WCSLIB ${_wcslib}
    282303              HINTS /usr/lib64 /usr/lib ${casaroot}/${arch}/lib )
    283304if( WCSLIB STREQUAL WCSLIB-NOTFOUND )
    284    message( FATAL_ERROR "${_wcslib} could not be found. Please check!" )
     305   message( STATUS "${_wcslib} could not be found." )
     306   unset( _wcslib CACHE )
     307   unset( WCSLIB CACHE )
     308   set( _wcslib libwcs.${_wcs_version}.${SO} )
     309   message( STATUS "Try to find ${_wcslib}..." )
     310   find_library( WCSLIB ${_wcslib}
     311                 HINTS /usr/lib64 /usr/lib ${casaroot}/${arch}/lib )
     312   if( WCSLIB STREQUAL WCSLIB-NOTFOUND )
     313      message( FATAL_ERROR "${_wcslib} could not be found. Please check!" )
     314   endif()
    285315endif()
    286316message( STATUS "WCSLIB = " ${WCSLIB} )
     317find_path( WCSLIB_INCLUDE_DIR wcslib/wcs.h
     318           HINTS /usr/include ${casaroot}/${arch}/include )
     319if( WCSLIB_INCLUDE_DIR STREQUAL WCSLIB_INCLUDE_DIR-NOTFOUND )
     320   message( FATAL_ERROR "wcs.h could not be found. Please check!" )
     321endif()
     322message( STATUS "WCSLIB_INCLUDE_DIR = " ${WCSLIB_INCLUDE_DIR} )
    287323
    288324
     
    353389include_directories( ${CASACORE_INCLUDE_DIR}
    354390                     ${Boost_INCLUDE_DIR}
    355                      ${PYTHON_INCLUDE_DIR} )
     391                     ${PYTHON_INCLUDE_DIR}
     392                     ${WCSLIB_INCLUDE_DIR} )
     393message( STATUS "WCSLIB = " ${WCSLIB} )
    356394
    357395#
    358396# link path
    359397#
    360 set( CASACORE_LIBRARY_DIR ${casaroot}/${arch}/lib )
    361 link_directories( ${CASACORE_LIBRARY_DIR} )
     398#set( CASACORE_LIBRARY_DIR ${casaroot}/${arch}/lib )
     399#link_directories( ${CASACORE_LIBRARY_DIR} )
    362400
    363401
     
    374412# libraries and executables
    375413#
    376 set( ASAPLIB _asap )
     414set( ASAPLIB asap )
    377415set( PYRAPLIB pyrap )
    378416set( ATNFLIB atnf )
  • trunk/src/CMakeLists.txt

    r1957 r1958  
    7979set_target_properties( ${ASAPLIB}
    8080                       PROPERTIES
    81                        PREFIX "" )
     81                       PREFIX _
     82                       SUFFIX .so )
    8283
    8384target_link_libraries( ${ASAPLIB}
    84                        ${Boost_LIBRARIES}
     85                       #${Boost_LIBRARIES}
    8586                       ${PYRAPLIB}
    8687                       ${ATNFLIB}
    87                        ${CASACORE_LIBRARIES}
     88                       #${CASACORE_LIBRARIES}
    8889                       ${WCSLIB} )
    8990
Note: See TracChangeset for help on using the changeset viewer.