File: CMakeLists.txt

package info (click to toggle)
python-casacore 3.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,492 kB
  • sloc: python: 4,170; cpp: 1,549; makefile: 68
file content (41 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download | duplicates (2)
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
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(Casacore REQUIRED)
find_package(Boost REQUIRED COMPONENTS python3)

# 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()