File: CMakeLists.txt

package info (click to toggle)
purify 2.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 58,688 kB
  • sloc: cpp: 8,410; python: 375; makefile: 7
file content (46 lines) | stat: -rw-r--r-- 1,337 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
# adds include dirs which are located within the build directory
# That is, whathever package is downloaded automatically by the build system
# This complication arises because cmake won't install targets with headers that point to the build
# dir.
# Users will have to install packages globally for all the right headers to be found
function(add_include_dir)
  unset(privates)
  foreach(dir ${ARGN})
    file(RELATIVE_PATH rel "${PROJECT_BINARY_DIR}" "${dir}" )
    if(NOT "${rel}" MATCHES "^\\.\\./")
      list(APPEND privates "${dir}")
    endif()
  endforeach() 
  if(privates)
    include_directories(SYSTEM ${privates})
  endif()
endfunction()

add_include_dir(
  ${Boost_INCLUDE_DIR}
  ${CFitsIO_INCLUDE_DIR}
  ${CCFits_INCLUDE_DIR}/..
)

add_subdirectory(purify)
if(tests OR examples)
  configure_file(tests/directories.in.h "${PROJECT_BINARY_DIR}/include/purify/directories.h")
endif()
if(examples)
  add_subdirectory(example)
endif()
if(tests)
  add_subdirectory(tests)
endif()

if(TARGET casacore::ms)
  add_executable(purify main.cc cmdl.cc AlgorithmUpdate.cc)
  target_link_libraries(purify libpurify)
  set_target_properties(purify PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

  install(TARGETS purify
    EXPORT PurifyTargets
    DESTINATION share/cmake/Purify
    RUNTIME DESTINATION bin
  )
endif()