File: CMakeLists.txt

package info (click to toggle)
purify 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 186,836 kB
  • sloc: cpp: 17,731; python: 510; xml: 182; makefile: 7; sh: 6
file content (79 lines) | stat: -rw-r--r-- 2,928 bytes parent folder | download
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

include_directories("${PROJECT_SOURCE_DIR}/cpp" "${PROJECT_BINARY_DIR}/include")
add_library(common_catch_main_object OBJECT "common_catch_main.cc")
if(Catch2_FOUND)
  target_link_libraries(common_catch_main_object Catch2::Catch2)
endif()
if(EIGEN3_INCLUDE_DIR)
  target_include_directories(common_catch_main_object SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR})
endif()
if(sopt_FOUND)
  target_include_directories(common_catch_main_object SYSTEM PUBLIC ${sopt_INCLUDE_DIR})
endif()
target_include_directories(common_catch_main_object PUBLIC
  "${EXTERNAL_ROOT}/include/"
  "${PROJECT_BINARY_DIR}/include/"
)
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/outputs")


add_catch_test(convolution LIBRARIES libpurify)
add_catch_test(index_mapping LIBRARIES libpurify)
add_catch_test(measurement_factory LIBRARIES libpurify)
add_catch_test(purify_fitsio LIBRARIES libpurify)
add_catch_test(sparse LIBRARIES libpurify)
add_catch_test(wide_field_utilities LIBRARIES libpurify)
add_catch_test(wkernel LIBRARIES libpurify)

if(PURIFY_CASACORE)
  add_catch_test(casacore LIBRARIES libpurify ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} DEPENDS lookup_dependencies)
endif()

if(PURIFY_ARRAYFIRE)
  include_directories(${ArrayFire_INCLUDE_DIRS})
  add_catch_test(operators_gpu LIBRARIES libpurify ${ArrayFire_LIBRARIES})
endif()

if(PURIFY_H5)
  add_catch_test(purify_h5 LIBRARIES libpurify DEPENDS lookup_dependencies)
endif()

if(PURIFY_MPI)
  add_library(common_mpi_catch_main_object OBJECT "common_mpi_catch_main.cc")
  if(Catch2_FOUND)
    target_link_libraries(common_mpi_catch_main_object Catch2::Catch2)
  endif()
  if(EIGEN3_INCLUDE_DIR)
    target_include_directories(common_mpi_catch_main_object SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR})
  endif()
  if(sopt_FOUND)
    target_include_directories(common_mpi_catch_main_object SYSTEM PUBLIC ${sopt_INCLUDE_DIR})
  endif()
  target_include_directories(common_mpi_catch_main_object
    PUBLIC ${PROJECT_BINARY_DIR}/include ${MPI_CXX_INCLUDE_PATH})

  function(add_mpi_test testname)
    add_catch_test(${testname} COMMON_MAIN common_mpi_catch_main_object NOTEST ${ARGN})
    unset(arguments)
    if(CATCH_JUNIT)
      set(arguments -r junit -o ${PROJECT_BINARY_DIR}/Testing/${testname}.xml)
    endif()
    if(NOT MPIEXEC_MAX_NUMPROCS)
      set(MPIEXEC_MAX_NUMPROCS 4)
    endif()
    add_test(NAME ${testname}
      COMMAND
      ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS}
      "./test_${testname}" ${arguments})
    set_tests_properties(${testname} PROPERTIES LABELS "catch;mpi")
  endfunction()

  add_mpi_test(distribute_sparse_vector LIBRARIES libpurify)
  add_mpi_test(mpi_utilities LIBRARIES libpurify)
  add_mpi_test(mpi_wavelet_factory LIBRARIES libpurify)
  add_mpi_test(mpi_wide_field_utilities LIBRARIES libpurify)
  add_mpi_test(parallel_mpi_utilities LIBRARIES libpurify)
endif()

install(DIRECTORY ${CMAKE_SOURCE_DIR}/data DESTINATION .)