1 | ### |
---|
2 | # CMakeLists.txt for build with casa |
---|
3 | ### |
---|
4 | |
---|
5 | |
---|
6 | # install directory |
---|
7 | # set casaroot |
---|
8 | # the regular expression means '../' |
---|
9 | # [^ ] Matches any character(s) not inside the brackets |
---|
10 | # + Matches preceding pattern one or more times |
---|
11 | # ? Matches preceding pattern zero or once only |
---|
12 | # $ Mathces at end of a line |
---|
13 | string( REGEX REPLACE /[^/]+/?$ "" casaroot ${CMAKE_SOURCE_DIR} ) |
---|
14 | message( STATUS "casaroot = " ${casaroot} ) |
---|
15 | |
---|
16 | # modules |
---|
17 | set( CMAKE_MODULE_PATH ${casaroot}/code/install ) |
---|
18 | include( config ) |
---|
19 | include( CASA ) |
---|
20 | |
---|
21 | # environment dependent settings |
---|
22 | if( APPLE ) |
---|
23 | if( NOT arch ) |
---|
24 | set( arch darwin ) |
---|
25 | endif() |
---|
26 | if( CMAKE_SYSTEM MATCHES ^Darwin-10 ) |
---|
27 | if( NOT archflag ) |
---|
28 | if( EXISTS /opt/casa/darwin10-64b ) |
---|
29 | set( archflag x86_64 ) |
---|
30 | elseif( EXISTS /opt/casa/core2-apple-darwin10 ) |
---|
31 | set( archflag i386 ) |
---|
32 | else() |
---|
33 | set( archflag x86_64 ) |
---|
34 | endif() |
---|
35 | endif() |
---|
36 | if( archflag STREQUAL x86_64 ) |
---|
37 | set( casa_packages /opt/casa/darwin10-64b ) |
---|
38 | else() |
---|
39 | set( casa_packages /opt/casa/core2-apple-darwin10 ) |
---|
40 | endif() |
---|
41 | elseif( CMAKE_SYSTEM MATCHES ^Darwin-9 ) |
---|
42 | set( casa_packages /opt/casa/core2-apple-darwin8/3rd-party ) |
---|
43 | endif() |
---|
44 | elseif( CMAKE_SYSTEM_NAME STREQUAL Linux ) |
---|
45 | if( CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 ) |
---|
46 | set( casa_packages /usr/lib64/casapy ) |
---|
47 | if( NOT arch ) |
---|
48 | set( arch linux_64b ) |
---|
49 | endif() |
---|
50 | else() |
---|
51 | set( casa_packages /usr/lib/casapy ) |
---|
52 | if( NOT arch ) |
---|
53 | set( arch linux_gnu ) |
---|
54 | endif() |
---|
55 | endif() |
---|
56 | endif() |
---|
57 | message( STATUS "arch = " ${arch} ) |
---|
58 | |
---|
59 | # set root directory for installation |
---|
60 | set( CMAKE_INSTALL_PREFIX ${casaroot}/${arch} ) |
---|
61 | |
---|
62 | |
---|
63 | # |
---|
64 | # casacore |
---|
65 | # |
---|
66 | set( CASACORE_PATHS "${casaroot}/${arch};${casaroot};/usr/local;/usr" ) |
---|
67 | |
---|
68 | |
---|
69 | # |
---|
70 | # Boost |
---|
71 | # |
---|
72 | if( NOT BOOST_ROOT ) |
---|
73 | set( BOOST_ROOT ${casa_packages} ) |
---|
74 | endif() |
---|
75 | |
---|
76 | |
---|
77 | # |
---|
78 | # wcslib |
---|
79 | # |
---|
80 | set( WCSLIB_PATHS "${casaroot}/${arch};/usr/local;/usr" ) |
---|
81 | |
---|
82 | |
---|
83 | # |
---|
84 | # subdirectories |
---|
85 | # ASAP2TO3 asap2to3 apps |
---|
86 | # PYRAPLIB libpyrap.so external/libpyrap |
---|
87 | # ATNFLIB libatnf.so external-alma/atnf |
---|
88 | # ASAPLIB _asap.so src |
---|
89 | # python modules python |
---|
90 | # shared files share |
---|
91 | # |
---|
92 | macro( asap_add_subdirectory ) |
---|
93 | add_subdirectory( apps ) |
---|
94 | add_subdirectory( external/libpyrap ) |
---|
95 | add_subdirectory( external-alma/atnf ) |
---|
96 | add_subdirectory( src ) |
---|
97 | add_subdirectory( python ) |
---|
98 | add_subdirectory( share ) |
---|
99 | endmacro( asap_add_subdirectory ) |
---|
100 | |
---|