File: CMakeLists.txt

package info (click to toggle)
purify 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 186,836 kB
  • sloc: cpp: 17,731; python: 510; xml: 182; makefile: 7; sh: 6
file content (61 lines) | stat: -rw-r--r-- 1,730 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
# 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(
  ${EIGEN3_INCLUDE_DIR}
  ${Boost_INCLUDE_DIR}
  ${cfitsio_INCLUDE_DIR}
  ${yaml-cpp_INCLUDE_DIR}
  ${Cubature_INCLUDE_DIR}
  ${CImg_INCLUDE_DIR}
  ${HDF5_INCLUDE_DIR}
  ${HighFive_INCLUDE_DIR}
)


link_directories(${FFTW3_LIBRARY_DIRS} ${YAML_CPP_LIBRARY_DIR} ${Cubature_LIBRARY_DIR})
add_subdirectory(purify)
if(tests OR examples OR benchmarks)
  configure_file(tests/directories.in.h "${PROJECT_BINARY_DIR}/include/purify/directories.h")
endif()
if(examples)
  add_subdirectory(example)
endif()
if(tests)
  configure_file(tests/data.in.h "${PROJECT_BINARY_DIR}/include/purify/test_data.h")
  add_subdirectory(tests)
endif()
if(benchmarks)
  add_subdirectory(benchmarks)
endif()
if (docs)
  add_subdirectory(docs)
endif()

add_subdirectory(uncertainty_quantification)

add_executable(purify main.cc)
set_target_properties(purify PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
target_link_libraries(purify libpurify ${sopt_LIBRARIES})

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