Changeset 1958
- Timestamp:
- 12/07/10 19:56:51 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r1957 r1958 5 5 # minimum requirement for cmake version 6 6 cmake_minimum_required( VERSION 2.8 ) 7 8 # Define compiler paths on OSX 10.5. This must be done before invoking project() 9 if( 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() 22 endif() 7 23 8 24 # project name is ASAP … … 33 49 34 50 # environment dependent settings 51 message( STATUS "CMAKE_SYSTEM = " ${CMAKE_SYSTEM} ) 35 52 if( APPLE ) 36 53 set( SO dylib ) … … 38 55 set( arch darwin ) 39 56 endif() 40 if( CMAKE_SYSTEM MAT HCES ^Darwin-10 )57 if( CMAKE_SYSTEM MATCHES ^Darwin-10 ) 41 58 if( NOT archflag ) 42 59 if( EXISTS /opt/casa/darwin10-64b ) … … 92 109 set( CMAKE_CXX_FLAGS ${DEFAULT_CXX_FLAGS} ) 93 110 111 # DL 112 set( DL_LIBRARIES ${CMAKE_DL_LIBS} CACHE STRING "dl libraries" FORCE ) 113 if( DL_LIBRARIES STREQUAL "dl" ) 114 set( DL_LIBRARIES "-ldl" CACHE STRING "dl libraries" FORCE ) 115 endif() 116 message( STATUS "DL_LIBRARIES = " ${DL_LIBRARIES} ) 94 117 95 118 # … … 98 121 if( NOT USE_LIBCASACORE ) 99 122 # use casacore libraries 100 set( _includename aipsdef.h )101 find_path( CASACORE_INC PATH${_includename}123 set( _includename casa/aipsdef.h ) 124 find_path( CASACORE_INCLUDE_DIR ${_includename} 102 125 HINTS ${casaroot}/${arch}/include/ 103 PATH_SUFFIXES casacore /casa)104 if( CASACORE_INC PATH STREQUAL CASACORE_INCPATH-NOTFOUND )126 PATH_SUFFIXES casacore ) 127 if( CASACORE_INCLUDE_DIR STREQUAL CASACORE_INCLUDE_DIR-NOTFOUND ) 105 128 message( FATAL_ERROR "${_includename} could not be found. Please check!" ) 106 else()107 string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} )108 129 endif() 109 130 set( CASACORE_LIBS casa … … 127 148 PATHS ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES lib ) 128 149 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} ) 130 152 endif() 131 153 endforeach() … … 138 160 message( FATAL_ERROR "${_libname} could not be found. Please check!" ) 139 161 endif() 140 set( _includename aipsdef.h )141 find_path( CASACORE_INC PATH${_includename}142 PATH_SUFFIXES casacore /casa)143 if( CASACORE_INC PATH 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 ) 144 166 message( FATAL_ERROR "${_includename} could not be found. Please check!" ) 145 else()146 string( REGEX REPLACE /[^/]+/?$ "" CASACORE_INCLUDE_DIR ${CASACORE_INCPATH} )147 167 endif() 148 168 endif() … … 279 299 # 280 300 set( _wcslib libwcs.${SO} ) 301 set( _wcs_version 4.3 ) 281 302 find_library( WCSLIB ${_wcslib} 282 303 HINTS /usr/lib64 /usr/lib ${casaroot}/${arch}/lib ) 283 304 if( 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() 285 315 endif() 286 316 message( STATUS "WCSLIB = " ${WCSLIB} ) 317 find_path( WCSLIB_INCLUDE_DIR wcslib/wcs.h 318 HINTS /usr/include ${casaroot}/${arch}/include ) 319 if( WCSLIB_INCLUDE_DIR STREQUAL WCSLIB_INCLUDE_DIR-NOTFOUND ) 320 message( FATAL_ERROR "wcs.h could not be found. Please check!" ) 321 endif() 322 message( STATUS "WCSLIB_INCLUDE_DIR = " ${WCSLIB_INCLUDE_DIR} ) 287 323 288 324 … … 353 389 include_directories( ${CASACORE_INCLUDE_DIR} 354 390 ${Boost_INCLUDE_DIR} 355 ${PYTHON_INCLUDE_DIR} ) 391 ${PYTHON_INCLUDE_DIR} 392 ${WCSLIB_INCLUDE_DIR} ) 393 message( STATUS "WCSLIB = " ${WCSLIB} ) 356 394 357 395 # 358 396 # link path 359 397 # 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} ) 362 400 363 401 … … 374 412 # libraries and executables 375 413 # 376 set( ASAPLIB _asap )414 set( ASAPLIB asap ) 377 415 set( PYRAPLIB pyrap ) 378 416 set( ATNFLIB atnf ) -
trunk/src/CMakeLists.txt
r1957 r1958 79 79 set_target_properties( ${ASAPLIB} 80 80 PROPERTIES 81 PREFIX "" ) 81 PREFIX _ 82 SUFFIX .so ) 82 83 83 84 target_link_libraries( ${ASAPLIB} 84 ${Boost_LIBRARIES}85 #${Boost_LIBRARIES} 85 86 ${PYRAPLIB} 86 87 ${ATNFLIB} 87 ${CASACORE_LIBRARIES}88 #${CASACORE_LIBRARIES} 88 89 ${WCSLIB} ) 89 90
Note:
See TracChangeset
for help on using the changeset viewer.