source: trunk/CMakeLists.txt@ 2297

Last change on this file since 2297 was 2297, checked in by Takeshi Nakazato, 14 years ago

New Development: No

JIRA Issue: No

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

Linker flags '-Wl,-s' is effective only for linking.


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