-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (47 loc) · 1.43 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
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.8)
project(SNR VERSION 4.0)
include(GNUInstallDirs)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native -mtune=native")
set(TARGET_LINK_LIBRARIES snr isa_utils isa_opencl astrodata OpenCL)
if($ENV{LOFAR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_HDF5")
set(TARGET_LINK_LIBRARIES ${TARGET_LINK_LIBRARIES} hdf5 hdf5_cpp z)
endif()
if($ENV{PSRDADA})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_PSRDADA")
set(TARGET_LINK_LIBRARIES ${TARGET_LINK_LIBRARIES} psrdada cudart)
endif()
set(SNR_HEADER
include/configuration.hpp
include/SNR.hpp
)
# libsnr
add_library(snr SHARED
src/SNR.cpp
)
set_target_properties(snr PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
PUBLIC_HEADER "include/SNR.hpp"
)
target_include_directories(snr PRIVATE include)
# SNRTesting
add_executable(SNRTesting
src/SNRTest.cpp
${SNR_HEADER}
)
target_include_directories(SNRTesting PRIVATE include)
target_link_libraries(SNRTesting PRIVATE ${TARGET_LINK_LIBRARIES})
# SNRTuning
add_executable(SNRTuning
src/SNRTuning.cpp
${SNR_HEADER}
)
target_include_directories(SNRTuning PRIVATE include)
target_link_libraries(SNRTuning PRIVATE ${TARGET_LINK_LIBRARIES})
install(TARGETS snr SNRTesting SNRTuning
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)