This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
135 lines (111 loc) · 3.91 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
cmake_minimum_required(VERSION 3.8)
set(SRCNAME "CommandLineInterface")
option(python_build "Compile Python Wrappers" OFF)
project(CLIcore C)
find_package(PkgConfig REQUIRED)
find_package(GSL QUIET REQUIRED)
pkg_check_modules(FFTW REQUIRED fftw3)
pkg_check_modules(FFTWF REQUIRED fftw3f)
pkg_check_modules(NCURSES REQUIRED ncurses)
pkg_check_modules(HWLOC hwloc)
if(${python_build})
set(CORE_FILES standalone_dependencies.c)
else()
include_directories("${PROJECT_SOURCE_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/..")
find_package(BISON)
find_package(FLEX)
# find_package(Curses REQUIRED) # already performed in main build dir
find_package(Threads REQUIRED)
bison_target(MilkBison calc_bison.y ${PROJECT_SOURCE_DIR}/calc_bison.c)
flex_target(MilkFlex calc_flex.l ${PROJECT_SOURCE_DIR}/calc_flex.c)
add_flex_bison_dependency(MilkFlex MilkBison)
set(CORE_FILES
CLIcore.c
${BISON_MilkBison_OUTPUTS}
${FLEX_MilkFlex_OUTPUTS})
endif()
link_directories(${NCURSES_LIBRARY_DIRS} ${HWLOC_LIBRARY_DIRS})
# main
add_library(CLIcore
SHARED
processtools.c
streamCTRL.c
function_parameters.c
${CORE_FILES})
if(${python_build})
set(USE_CUDA ON)
if(NOT TARGET ImageStreamIO)
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/../ImageStreamIO)
add_subdirectory( ${PROJECT_SOURCE_DIR}/../ImageStreamIO ImageStreamIO)
else()
add_subdirectory($ENV{OCTOPUS_ROOT}/tplib/ImageStreamIO ImageStreamIO)
endif()
endif()
target_compile_definitions(CLIcore PUBLIC STANDALONE)
target_include_directories(
CLIcore
PUBLIC ${CUDA_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../ImageStreamIO)
target_link_libraries(CLIcore PUBLIC ImageStreamIO)
else()
target_include_directories(CLIcore
PUBLIC ${PROJECT_SOURCE_DIR}/..
${PROJECT_SOURCE_DIR}/src
${GSL_INCLUDE_DIRS}
${FFTW_INCLUDE_DIRS}
${FFTWF_INCLUDE_DIRS})
target_compile_options(CLIcore
PUBLIC ${FFTW_CFLAGS_OTHER} ${FFTWF_CFLAGS_OTHER})
target_link_libraries(CLIcore
PUBLIC m
readline
cfitsio
dl
rt
${GSL_LIBRARIES}
${FFTW_LIBRARIES}
${FFTWF_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CURSES_LIBRARIES})
endif()
if(${HWLOC_FOUND})
target_compile_definitions(CLIcore PRIVATE USE_HWLOC)
endif()
target_include_directories(CLIcore
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
${HWLOC_INCLUDE_DIR} ${NCURSES_INCLUDE_DIR})
target_compile_options(CLIcore PUBLIC)
target_link_libraries(CLIcore
PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${HWLOC_LIBRARIES}
${NCURSES_LIBRARIES})
if(${python_build})
add_subdirectory(python_module)
endif()
install(TARGETS CLIcore DESTINATION bin)
install(PROGRAMS
scripts/milk-exec
scripts/milk-streamCTRL
scripts/milk-procCTRL
scripts/milk-fpsCTRL
scripts/milk-cr2tofits
scripts/milk-FITS2shm
scripts/milk-fpsmkcmd
scripts/milk-logshim
scripts/milk-logshimkill
scripts/milk-logshimoff
scripts/milk-logshimon
scripts/milk-logshimstat
scripts/merge3DfitsTelemetry
scripts/milk-streamlink
scripts/milk-shm2FITS
scripts/tmuxkillall
scripts/tmuxsessionname
scripts/waitforfile
DESTINATION bin)
install(TARGETS CLIcore DESTINATION lib)
install(FILES CLIcore.h
processtools.h
streamCTRL.h
function_parameters.h
standalone_dependencies.h
DESTINATION include/${SRCNAME})