-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
41 lines (37 loc) · 1.12 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.15...3.26)
project(python-casacore)
find_package(
Python
COMPONENTS Interpreter Development.Module
REQUIRED)
# Find Casacore and its dependencies
find_package(PkgConfig REQUIRED)
pkg_check_modules(Casacore REQUIRED casacore)
find_package(Boost REQUIRED COMPONENTS python)
# If environment variable CASACORE_DATA is set, assume it points to a directory
# containing the cascacore data files, and install its contents.
if(DEFINED ENV{CASACORE_DATA})
foreach(_dir ephemerides geodetic)
if(NOT IS_DIRECTORY $ENV{CASACORE_DATA}/${_dir})
message(
SEND_ERROR
"Directory $ENV{CASACORE_DATA}/${_dir} does not exist. "
"Does environment variable CASACORE_DATA point to a valid data directory?"
)
endif()
endforeach()
install(
DIRECTORY $ENV{CASACORE_DATA}
DESTINATION casacore
COMPONENT data)
else()
message(
WARNING
"Environment variable CASACORE_DATA is not defined. "
"Casacore data files will not be included in the python-casacore package."
)
endif()
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()