-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
66 lines (48 loc) · 2.31 KB
/
CMakeLists.txt
File metadata and controls
66 lines (48 loc) · 2.31 KB
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
cmake_minimum_required(VERSION 2.8.8)
project(aartfaac2ms)
include(CMakeVersionInfo.txt)
if(PORTABLE)
add_compile_options(-O3 -ggdb -Wvla -Wall -DNDEBUG)
else()
add_compile_options(-O3 -ggdb -Wvla -Wall -DNDEBUG -march=native)
endif(PORTABLE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
include_directories(${CMAKE_SOURCE_DIR}/aocommon/include)
find_package(AOFlagger 3 REQUIRED)
include_directories(${AOFLAGGER_INCLUDE_DIR})
find_package(CFITSIO REQUIRED)
include_directories(${CFITSIO_INCLUDE_DIRS})
find_package(Threads REQUIRED)
find_package(Boost 1.55.0 REQUIRED COMPONENTS date_time filesystem)
set(CASACORE_MAKE_REQUIRED_EXTERNALS_OPTIONAL TRUE)
find_package(Casacore REQUIRED COMPONENTS casa ms tables measures fits scimath scimath_f)
include_directories(${CASACORE_INCLUDE_DIRS})
# The following stuff will set the "rpath" correctly, so that
# LD_LIBRARY_PATH doesn't have to be set.
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")
configure_file(version.h.in version.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(aartfaac2ms main.cpp aartfaac2ms.cpp aartfaacms.cpp averagingwriter.cpp fitsuser.cpp fitswriter.cpp mswriter.cpp progressbar.cpp stopwatch.cpp threadedwriter.cpp)
target_link_libraries(aartfaac2ms
${AOFLAGGER_LIB} ${CASACORE_LIBRARIES}
${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
Threads::Threads)
add_executable(afedit afedit.cpp)
target_link_libraries(afedit ${CASACORE_LIBRARIES} Threads::Threads)
install(TARGETS aartfaac2ms afedit DESTINATION bin)
message(STATUS "Flags passed to C++ compiler: " ${CMAKE_CXX_FLAGS})