source: trunk/CMakeLists.txt@ 2359

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

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: Defined CXX_FLAGS_TAIL_END

Test Programs: build asap

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Defined CXX_FLAGS_TAIL_END option. If it is defined when cmaking,
those options will be put at the end of compile options.

File size: 19.1 KB
RevLine 
[1954]1###
2# CMakeLists.txt for ASAP module
3###
4
5# minimum requirement for cmake version
6cmake_minimum_required( VERSION 2.8 )
7
[1968]8# options
9option( USE_LIBCASACORE
10 "set ON to use libcasacore.so instead of libcasa_*.so"
11 OFF )
12option( STANDALONE
13 "set ON to build standalone mode"
14 OFF )
15message( STATUS "USE_LIBCASACORE = " ${USE_LIBCASACORE} )
16message( STATUS "STANDALONE = " ${STANDALONE} )
[1958]17
[1970]18# Define compiler paths on OSX 10.5. This must be done before invoking project()
19if( APPLE )
20 if( EXISTS /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
21 set( CMAKE_Fortran_COMPILER /opt/casa/core2-apple-darwin8/3rd-party/bin/gfortran )
22 set( CMAKE_CXX_COMPILER /opt/casa/core2-apple-darwin8/3rd-party/bin/g++ )
23 elseif( EXISTS /opt/local/bin/gfortran )
24 set( CMAKE_Fortran_COMPILER /opt/local/bin/gfortran )
25 elseif( EXISTS /opt/local/bin/gfortran-mp-4.4 )
26 set( CMAKE_Fortran_COMPILER /opt/local/bin/gfortran-mp-4.4 )
27 if( EXISTS /opt/local/bin/g++-mp-4.4 )
28 set( CMAKE_CXX_COMPILER /opt/local/bin/g++-mp-4.4 )
29 endif()
30 endif()
31endif()
32
[2296]33
[1970]34# project name is ASAP
35project( ASAP )
36
[2296]37
38#
39# build type and their flags
40#
41# CMAKE_BUILD_TYPE (Release, Debug, RelWithDebInfo, MinSizeRel, Profile)
42# default is RelWithDebInfo
43#
44if ( NOT CMAKE_BUILD_TYPE )
45 set( CMAKE_BUILD_TYPE RelWithDebInfo )
46endif()
47message( STATUS "CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE} )
48
49# flags for Debug build
50if ( CMAKE_BUILD_TYPE STREQUAL Debug )
51 add_definitions( -DAIPS_DEBUG )
52endif()
53set( CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -O0 -fno-omit-frame-pointer" )
54
55# flags for Profile build
56set( CMAKE_CXX_FLAGS_PROFILE "-g -O2 -pg -fprofile-arcs -fno-omit-frame-pointer" )
57
58# flags for Release build
[2297]59set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s" )
60set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-s" )
[2296]61
62# flags for MinSizeRel build
[2297]63set( CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "-Wl,-s" )
64set( CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-Wl,-s" )
[2296]65
[2298]66if ( DEFINED CXX_FLAGS_TAIL_END )
67 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_TAIL_END}" )
68 set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CXX_FLAGS_TAIL_END}" )
69 set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${CXX_FLAGS_TAIL_END}" )
70 set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CXX_FLAGS_TAIL_END}" )
71 set( CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${CXX_FLAGS_TAIL_END}" )
72endif()
73
[2296]74# default flags
[1970]75set( DEFAULT_CXX_FLAGS
[2296]76 "-pipe -Wall -Wextra -Wno-non-template-friend -Wcast-align -Wno-comment" )
77
[1970]78find_package( OpenMP )
79if( OPENMP_FOUND )
80 set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
81endif()
82
83# environment dependent settings
84message( STATUS "CMAKE_SYSTEM = " ${CMAKE_SYSTEM} )
85message( STATUS "CMAKE_SYSTEM_PROCESSOR = " ${CMAKE_SYSTEM_PROCESSOR} )
86if( APPLE )
87 set( SO dylib )
88 if( CMAKE_SYSTEM MATCHES ^Darwin-10 )
89 if( NOT archflag )
90 if( EXISTS /opt/casa/darwin10-64b )
91 set( archflag x86_64 )
92 elseif( EXISTS /opt/casa/core2-apple-darwin10 )
93 set( archflag i386 )
94 else()
95 set( archflag x86_64 )
96 endif()
97 endif()
98 if( archflag STREQUAL x86_64 )
99 add_definitions( -DAIPS_64B )
100 endif()
101 execute_process( COMMAND ${CMAKE_CXX_COMPILER} --version
102 COMMAND head -1
103 COMMAND perl -pe "s|.*?(\\d+\\.\\d+)\\.\\d+$|$1|"
104 OUTPUT_VARIABLE _cxx_version
105 OUTPUT_STRIP_TRAILING_WHITESPACE )
106 if( NOT _cxx_version STREQUAL "4.4" )
107 set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -arch ${archflag}" )
108 endif()
109 endif()
110elseif( CMAKE_SYSTEM_NAME STREQUAL Linux )
111 set( SO so )
112 add_definitions( -DAIPS_LINUX )
113 if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 )
114 add_definitions( -DAIPS_64B )
115 set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -Wno-deprecated" )
116 else()
117 set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -Wno-deprecated -Woverloaded-virtual" )
118 endif()
119endif()
120
[2296]121# set flags for cpp compiler
122set( CMAKE_CXX_FLAGS ${DEFAULT_CXX_FLAGS} )
[1970]123
[2296]124
[1960]125#
[2296]126# casacore definitions
127#
128set( CASACORE_DEFINITIONS ${CASACORE_DEFINITIONS}
129 -DCASA_USECASAPATH
130 -DCASACORE_NEEDS_RETHROW
131 -DAIPS_STDLIB
132 -DAIPS_AUTO_STL
133 -D_GNU_SOURCE )
134
135if( CMAKE_SYSTEM_NAME STREQUAL Linux )
136 set( CASACORE_DEFINITIONS ${CASACORE_DEFINITIONS}
137 -D_FILE_OFFSET_BITS=64
138 -D_LARGEFILE_SOURCE
139 )
140endif()
141
142add_definitions( ${CASACORE_DEFINITIONS} )
143
144
145#
[1968]146# mode specific settings
[1960]147#
[1968]148# STANDALONE=ON standalone build
149# STANDALONE=OFF build with casa
[1954]150#
[1968]151set( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake" )
152message( STATUS "CMAKE_MODULE_PATH = " ${CMAKE_MODULE_PATH} )
153if( STANDALONE )
154 include( standalone )
[1956]155else()
[1968]156 include( withcasa )
[1956]157endif()
[1954]158
[1970]159message( STATUS "CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX} )
[1957]160
[1970]161
[1954]162#
[1970]163# casacore
164#
165unset( CASACORE_INCLUDE_DIR CACHE )
166unset( CASACORE_LIBRARIES CACHE )
167if( NOT USE_LIBCASACORE )
168 # use casacore libraries
169 set( _includename casa/aipsdef.h )
170 find_path( CASACORE_INCLUDE_DIR ${_includename}
171 PATHS ${CASACORE_PATHS}
172 PATH_SUFFIXES include include/casacore
173 NO_DEFAULT_PATH )
174 find_path( CASACORE_INCLUDE_DIR ${_includename} )
175 if( CASACORE_INCLUDE_DIR MATCHES "NOTFOUND$" )
176 message( FATAL_ERROR "${_includename} could not be found. Please check!" )
177 endif()
178 set( CASACORE_LIBS casa
179 components
180 coordinates
181 fits
182 images
183 lattices
184 measures
185 mirlib
186 ms
187 msfits
188 scimath
189 scimath_f
190 tables )
191 set( _casacore_libs "" )
192 foreach( _a ${CASACORE_LIBS} )
193 set( _libname libcasa_${_a}.${SO} )
194 unset( _casacore_lib CACHE )
195 find_library( _casacore_lib ${_libname}
196 PATHS ${CASACORE_PATHS}
197 PATH_SUFFIXES lib64 lib )
198 if( _casacore_lib MATCHES "NOTFOUND$" )
199 message( FATAL_ERROR "${_libname} could not be found. Please check!" )
200 else()
201 #list( APPEND _casacore_libs casa_${_a} )
202 list( APPEND _casacore_libs ${_casacore_lib} )
203 endif()
204 endforeach()
205 set( CASACORE_LIBRARIES ${_casacore_libs} )
206else()
207 # use libcasacore
208 set( _libname libcasacore.${SO} )
209 find_library( CASACORE_LIBRARIES ${_libname}
210 PATHS ${CASACORE_PATHS}
211 PATH_SUFFIXES lib64 lib )
212 if( CASACORE_LIBRARIES MATCHES "NOTFOUND$" )
213 message( FATAL_ERROR "${_libname} could not be found. Please check!" )
214 endif()
215 set( _includename casa/aipsdef.h )
[1972]216 string( REGEX REPLACE /[^/]+/[^/]+/?$ "" _coreroot ${CASACORE_LIBRARIES} )
217 find_path( CASACORE_INCLUDE_DIR ${_includename}
218 PATHS ${_coreroot}
219 PATH_SUFFIXES include include/casacore
220 NO_DEFAULT_PATH )
[1970]221 find_path( CASACORE_INCLUDE_DIR ${_includename}
222 PATHS ${CASACORE_PATHS}
223 PATH_SUFFIXES include include/casacore
224 NO_DEFAULT_PATH )
225 find_path( CASACORE_INCLUDE_DIR ${_includename} )
226 if( CASACORE_INCLUDE_DIR MATCHES "NOTFOUND$" )
227 message( FATAL_ERROR "${_includename} could not be found. Please check!" )
228 endif()
229endif()
230message( STATUS "CASACORE_LIBRARIES = " ${CASACORE_LIBRARIES} )
231message( STATUS "CASACORE_INCLUDE_DIR = " ${CASACORE_INCLUDE_DIR} )
232unset( USE_LIBCASACORE CACHE )
233
234
235#
236# Python
237#
238if( STANDALONE )
239 include( FindPythonLibs )
240 if( NOT PYTHONLIBS_FOUND )
241 message( FATAL_ERROR "Python could not be found. Please check!" )
242 endif()
243
244 # Define pyroot
245 string( REGEX REPLACE "/[^/]+/[^/]+/?$" "" pyroot ${PYTHON_INCLUDE_DIRS} )
246
247 # find numpy
248 string( REGEX MATCH [0-9].[0-9] PYTHONV ${PYTHON_INCLUDE_DIRS} )
249 string( REPLACE "." "" PV ${PYTHONV} )
250 find_path( NUMPY_INCLUDE_DIR numpy/npy_interrupt.h
251 PATHS
[1971]252 ${pyroot}/lib/python${PYTHONV}/site-packages/numpy/core
253 ${pyroot}/Library/Frameworks/Python.framework/Versions/${PYTHONV}
254 ${pyroot}/Library/Frameworks/Python.framework/Versions/${PYTHONV}/lib/python${PYTHONV}/site-packages/numpy/core
[1970]255 PATH_SUFFIXES include )
256 if( NUMPY_INCLUDE_DIR MATCHES "NOTFOUND$" )
257 message( FATAL_ERROR "numpy/npy_interrupt.h could not be found. Please check!" )
258 endif()
259 list( APPEND PYTHON_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR} )
260
261 set( PYTHON_DEFINITIONS ${PYTHON_DEFINITIONS}
262 -DPYTHONROOT=\"${pyroot}\"
263 -DPYTHONVER=\"${PYTHONV}\"
264 -DPYVERSION=${PV} )
265else()
266 if( NOT PYTHON_FOUND )
267 if ( NOT PYTHON_LIBNAME )
268 set( _names 2.9 2.8 2.7 2.6 2.5.2 2.5 )
269 # (The library named libpython.2.5.2.dylib seems to exist only in the CASA world.)
270 else()
271 set( _names ${PYTHON_LIBNAME} )
272 endif()
273
274 set( _found False )
275 foreach( _v ${_names} )
276
277 casa_find(
278 PYTHON${_v}
279 LIBS python${_v}
280 NO_REQUIRE
281 )
282
283 if( PYTHON${_v}_FOUND )
284 set( PYTHON_LIBNAME ${_v} )
285 set( _found True )
286 break()
287 endif()
288
289 endforeach()
290
291 if( NOT _found )
292 message( FATAL_ERROR "Could not find any PYTHON library with version one of ${_names}. Please check!" )
293 endif()
294
295 endif()
296
297 if( NOT PYTHON_LIBNAME )
298 # Found Python, but PYTHON_LIBNAME is undefined, that is impossible.
299 message( FATAL_ERROR "The variable PYTHON_LIBNAME is undefined. Most likely, CMake's cache is out of date and you need to redetect your PYTHON installation (\"cmake -U PYTHON*\")")
300 endif()
301
302 string( SUBSTRING ${PYTHON_LIBNAME} 0 3 PYTHONV )
303 string( REPLACE "." "" PV ${PYTHONV} )
304 set( python_library python${PYTHON_LIBNAME} )
305
306 # Form the Python install prefix by stripping away "lib/libpython2.5.2.dylib" (example) from
307 # the full python library path
308 string( REGEX MATCH "/lib(64)?/lib${python_library}" _match ${PYTHON${PYTHON_LIBNAME}_LIBRARIES} )
309 if( _match )
310 string( REGEX REPLACE "/lib(64)?/lib${python_library}.*" "" python_prefix ${PYTHON${PYTHON_LIBNAME}_LIBRARIES} )
311 else()
312 # Python library was not in a lib(64) directory!
313 message( WARNING "Python library path \"${PYTHON${PYTHON_LIBNAME}_LIBRARIES}\" does not contain \"/lib(64)/lib${python_library}\"" )
314 set( python_prefix ${casa_packages} )
315 endif()
316
317 # The python version and prefix is known, do the actual search
318 if( NOT PYTHON_FOUND )
319 message( STATUS "Looking for PYTHON version ${PYTHONV}.x in ${python_prefix}" )
320 endif()
321
322 casa_find( PYTHON
323 VERSION 2.5 # minimum required
324 INCLUDES Python.h
325 numpy/npy_interrupt.h # for numpy
326 INCLUDES_SUFFIXES python${PYTHONV}
327 PREFIX_HINTS
328 ${python_prefix}/lib/python${PYTHONV}/site-packages/numpy/core
329 ${python_prefix}/Library/Frameworks/Python.framework/Versions/${PYTHONV}
330 ${python_prefix}/Library/Frameworks/Python.framework/Versions/${PYTHONV}/lib/python${PYTHONV}/site-packages/numpy/core
331 LIBS ${python_library}
332 CPP_VERSION PY_VERSION )
333
334 # Store PYTHON_LIBNAME in the cache
335 set( PYTHON_LIBNAME ${PYTHON_LIBNAME} CACHE STRING "Python major and minor version to use" FORCE )
336
337 # Define pyroot to two directory levels above Python.h.
338 string( REGEX REPLACE "/[^/]+/[^/]+/?$" "" pyroot ${PYTHON_Python.h} )
339
340 set( PYTHON_DEFINITIONS ${PYTHON_DEFINITIONS}
341 -DAIPSROOT=\"${CMAKE_SOURCE_DIR}\"
342 -DAIPSARCH=\"${arch}\"
343 -DAIPSSITE=\"garching\"
344 -DPYTHONROOT=\"${pyroot}\"
345 -DPYTHONVER=\"${PYTHONV}\"
346 -DPYVERSION=${PV} )
347endif()
348message( STATUS "PYTHON_INCLUDE_DIRS = " ${PYTHON_INCLUDE_DIRS} )
349message( STATUS "PYTHON_LINRARIES = " ${PYTHON_LIBRARIES} )
350message( STATUS "PYTHONV = " ${PYTHONV} )
351
352
353#
354# DL
355#
356set( DL_LIBRARIES ${CMAKE_DL_LIBS} CACHE STRING "dl libraries" FORCE )
357if( DL_LIBRARIES STREQUAL "dl" )
358 set( DL_LIBRARIES "-ldl" CACHE STRING "dl libraries" FORCE )
359endif()
360message( STATUS "DL_LIBRARIES = " ${DL_LIBRARIES} )
361
362
363#
364# BLAS
365#
366find_library( BLAS_LIBRARIES libblas.${SO} )
367if ( BLAS_LIBRARIES MATCHES "NOTFOUND$" )
368 message( FATAL_ERROR "blas could not be found. Please check!" )
369endif()
370message( STATUS "BLAS_LIBRARIES = " ${BLAS_LIBRARIES} )
371
372
373#
374# LAPACK
375#
376find_library( LAPACK_LIBRARIES liblapack.${SO} )
377if ( LAPACK_LIBRARIES MATCHES "NOTFOUND$" )
378 message( FATAL_ERROR "lapack could not be found. Please check!" )
379endif()
380message( STATUS "LAPACK_LIBRARIES = " ${LAPACK_LIBRARIES} )
381
382
383#
384# Boost
385#
386set( boost_components python )
[2280]387if( NOT STANDALONE )
388 set( boost_components ${boost_components} system )
389endif()
[1970]390find_package( Boost REQUIRED ${boost_components} )
391if( NOT Boost_FOUND )
392 message( FATAL_ERROR "Boost could not be found. Please check!" )
393endif()
394message( STATUS "BOOST_INCLUDE_DIR = " ${Boost_INCLUDE_DIR} )
395message( STATUS "BOOST_LIBRARIES = " ${Boost_LIBRARIES} )
396
397
398#
399# cfitsio
400#
401if( STANDALONE )
402 find_path( CFITSIO_INCLUDE_DIRS fitsio.h
403 PATH_SUFFIXES cfitsio )
404 if( CFITSIO_INCLUDE_DIRS MATCHES "NOTFOUND$" )
405 message( FATAL_ERROR "fitsio.h could not be found. Please check!" )
406 endif()
[1971]407 string( REGEX REPLACE "/[^/]+/?$" "" CFITSIO_ROOT ${CFITSIO_INCLUDE_DIRS} )
408 message( STATUS "CFITSIO_ROOT=" ${CFITSIO_ROOT} )
409 find_library( CFITSIO_LIBRARIES libcfitsio.${SO}
410 PATHS ${CFITSIO_ROOT}
411 PATH_SUFFIXES lib64 lib
412 NO_DEFAULT_PATH )
413 if( CFITSIO_LIBRARIES MATCHES "NOTFOUND$" )
414 find_library( CFITSIO_LIBRARIES libcfitsio.a
415 PATHS ${CFITSIO_ROOT}
416 PATH_SUFFIXES lib64 lib
417 NO_DEFAULT_PATH )
418 endif()
[1970]419 find_library( CFITSIO_LIBRARIES libcfitsio.${SO}
420 PATHS /usr/local /usr
421 PATH_SUFFIXES lib64 lib )
422 if( CFITSIO_LIBRARIES MATCHES "NOTFOUND$" )
423 message( FATAL_ERROR "libcfitsio.so could not be found. Please check!" )
424 endif()
425else()
426 casa_find( CFITSIO
427 VERSION 3.006
428 INCLUDES fitsio.h fitsio2.h
429 INCLUDES_SUFFIXES cfitsio
430 LIBS cfitsio
431 CPP_VERSION CFITSIO_VERSION
432 RUN_VERSION "(ffvers(&v), v)" )
433endif()
434message( STATUS "CFITSIO_INCLUDE_DIRS = " ${CFITSIO_INCLUDE_DIRS} )
435message( STATUS "CFITSIO_LIBRARIES = " ${CFITSIO_LIBRARIES} )
436
437
438#
439# Fortran
440#
441if( NOT FORTRAN_LIBRARIES )
442
443 message( STATUS "Looking for Fortran runtime libraries" )
444 set( _try ${CMAKE_BINARY_DIR}/try_fortran.cc )
445 file( WRITE ${_try}
446 "int main() { return 0; }\n"
447 )
448
449 if( _gfortran_lib_path )
450 try_compile( _have_gfortran ${CMAKE_BINARY_DIR} ${_try}
451 CMAKE_FLAGS -Wdev "-DCMAKE_EXE_LINKER_FLAGS=${_gfortran_lib_path}"
452 )
453 else()
454 try_compile( _have_gfortran ${CMAKE_BINARY_DIR} ${_try}
455 CMAKE_FLAGS -Wdev "-DCMAKE_EXE_LINKER_FLAGS=-lgfortran"
456 )
457 endif()
458 try_compile( _have_g2c ${CMAKE_BINARY_DIR} ${_try}
459 CMAKE_FLAGS -Wdev "-DCMAKE_EXE_LINKER_FLAGS=-lg2c"
460 )
461
462 if( _have_gfortran )
463 if( _gfortran_lib_path )
464 set( FORTRAN_LIBRARIES ${_gfortran_lib_path}
465 CACHE STRING "Fortran library linker option" FORCE )
466 else()
467 set( FORTRAN_LIBRARIES -lgfortran
468 CACHE STRING "Fortran library linker option" FORCE )
469 endif()
470 message( STATUS "Looking for Fortran runtime libraries -- ${FORTRAN_LIBRARIES}" )
471 elseif( _have_g2c )
472 set( FORTRAN_LIBRARIES -lg2c
473 CACHE STRING "Fortran library linker option" FORCE )
474 message( STATUS "Looking for Fortran runtime libraries -- ${FORTRAN_LIBRARIES}" )
475 else()
476 set( FORTRAN_LIBRARIES ""
477 CACHE STRING "Fortran library linker option" FORCE )
478 message( STATUS "Looking for Fortran runtime libraries -- <none>" )
479 # Not a fatal error because it might work, if all Fortran dependencies were
480 # already linked statically to the Fortran runtime...
481 endif()
482endif()
483
484
485#
486# RPFITS
487#
488if ( STANDALONE )
489 find_path( RPFITS_INCLUDE_DIRS RPFITS.h
490 PATHS /usr/local /usr
491 PATH_SUFFIXES include )
492 if( RPFITS_INCLUDE_DIRS MATCHES "NOTFOUND$" )
493 message( FATAL_ERROR "RPFITS.h could not be found. Please check!" )
494 endif()
495 find_library( RPFITS_LIBRARIES librpfits.so
496 PATHS /usr/local /usr
497 PATH_SUFFIXES lib64 lib )
498 if( RPFITS_LIBRARIES MATCHES "NOTFOUND$" )
499 message( FATAL_ERROR "librpfits.so could not be found. Please check!" )
500 endif()
501 list( APPEND RPFITS_LIBRARIES ${FORTRAN_LIBRARIES} )
502else()
503 casa_find( RPFITS
504 VERSION 2.11
505 INCLUDES RPFITS.h
506 LIBS rpfits
507 RUN_VERSION names_.rpfitsversion
508 DEPENDS FORTRAN )
509endif()
510message( STATUS "RPFITS_INCLUDE_DIRS = " ${RPFITS_INCLUDE_DIRS} )
511message( STATUS "RPFITS_LIBRARIES = " ${RPFITS_LIBRARIES} )
512
513
514#
515# wcslib
516#
517set( _wcslib libwcs.${SO} )
518set( _wcs_version 4.3 )
519find_library( WCSLIB ${_wcslib}
520 PATHS ${WCSLIB_PATHS}
521 PATH_SUFFIXES lib64 lib )
522if( WCSLIB MATCHES "NOTFOUND$" )
523 message( STATUS "${_wcslib} could not be found." )
524 unset( _wcslib CACHE )
525 unset( WCSLIB CACHE )
526 set( _wcslib libwcs.${_wcs_version}.${SO} )
527 message( STATUS "Try to find ${_wcslib}..." )
528 find_library( WCSLIB ${_wcslib}
529 PATHS ${WCSLIB_PATHS}
530 PATH_SUFFIXES lib64 lib )
531 if( WCSLIB MATCHES "NOTFOUND$" )
532 message( FATAL_ERROR "${_wcslib} could not be found. Please check!" )
533 endif()
534endif()
535message( STATUS "WCSLIB = " ${WCSLIB} )
536find_path( WCSLIB_INCLUDE_DIR wcslib/wcs.h
537 PATHS ${WCSLIB_PATHS}
538 PATH_SUFFIXES include )
539if( WCSLIB_INCLUDE_DIR MATCHES "NOTFOUND$" )
540 message( FATAL_ERROR "wcs.h could not be found. Please check!" )
541endif()
542message( STATUS "WCSLIB_INCLUDE_DIR = " ${WCSLIB_INCLUDE_DIR} )
543
544
545#
[1957]546# common include path
547#
[1954]548include_directories( ${CASACORE_INCLUDE_DIR}
549 ${Boost_INCLUDE_DIR}
[1962]550 ${PYTHON_INCLUDE_DIRS}
[1961]551 ${WCSLIB_INCLUDE_DIR}
552 ${CFITSIO_INCLUDE_DIRS}
[1962]553 ${RPFITS_INCLUDE_DIRS} )
[1954]554
555
[1957]556#
[1954]557# install directory
[1957]558#
[1954]559set( EXEC_INSTALL_DIR bin )
560set( LIB_INSTALL_DIR lib )
[1957]561set( PYTHON_INSTALL_DIR python/${PYTHONV}/asap )
[1954]562set( SHARED_INSTALL_DIR share/asap )
[2088]563
564#
565# execute getsvnrev.sh to create/update svninfo.txt
566# run chmod to make sure the script has executable
567#
568exec_program( chmod ARGS a+x ${ASAP_SOURCE_DIR}/getsvnrev.sh )
569exec_program( chmod ARGS a+x ${ASAP_SOURCE_DIR}/cmake/exec_getsvnrev.sh )
570exec_program( ${ASAP_SOURCE_DIR}/cmake/exec_getsvnrev.sh ARGS ${ASAP_SOURCE_DIR})
571
[1976]572# Add the modules to be built.
573#
574# Choose to have correct RPATHs both in the build tree and
575# in the install tree (at the cost of having to change the
576# rpath when installing)
577#
578set( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib )
579set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
580set( CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib )
[1954]581
[1957]582
[1976]583
[1957]584#
585# libraries and executables
586#
[1958]587set( ASAPLIB asap )
[1957]588set( PYRAPLIB pyrap )
589set( ATNFLIB atnf )
590set( ASAP2TO3 asap2to3 )
[2210]591if ( NOT STANDALONE )
[2273]592 set( ASDM2ASAP_OLD oldasdm2ASAP )
[2210]593 set( ASDM2ASAP asdm2ASAP )
594endif()
[1957]595
[1966]596#
597# always install by default
598#
599add_custom_target( inst ALL ${CMAKE_BUILD_TOOL} install/fast )
[1957]600
601#
[1954]602# subdirectories
[1957]603#
[1968]604asap_add_subdirectory()
Note: See TracBrowser for help on using the repository browser.