-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (44 loc) · 1.52 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
set(LIBNAME "milkAtmosphericTurbulence")
message("")
message(" SRCNAME = ${SRCNAME} -> LIBNAME = ${LIBNAME}")
# list source files (.c) other than modulename.c
set(SOURCEFILES
makeHV_CN2prof.c
make_master_turbulence_screen.c
make_master_turbulence_screen_pow.c
make_AtmosphericTurbulence_vonKarmanWind.c
AtmosphericTurbulence_prediction.c
make_wavefront_sequence.c
ReadConf.c
Z_Air.c
)
# list include files (.h) that should be installed on system
set(INCLUDEFILES
)
# list scripts that should be installed on system
set(SCRIPTFILES
scripts/milk-atmturb-runturb
scripts/milk-atmturb-mkconf
)
set(LINKLIBS
CLIcore
)
# DEFAULT SETTINGS
# Do not change unless needed
# =====================================================================
# SRCNAME is current directory (last subdir)
set(NAME0 "${CMAKE_CURRENT_SOURCE_DIR}")
string(REPLACE "/" " " NAME1 ${NAME0})
string(REGEX MATCH "[a-zA-Z0-9_]+$" SRCNAME "${NAME0}")
message(" SRCNAME = ${SRCNAME}")
project(lib_${LIBNAME}_project)
# Library can be compiled from multiple source files
# Convention: the main souce file is named <libname>.c
#
add_library(${LIBNAME} SHARED ${SRCNAME}.c ${SOURCEFILES})
target_include_directories(${LIBNAME} PUBLIC ${PROJECT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${LIBNAME} PRIVATE ${LINKLIBS})
install(TARGETS ${LIBNAME} DESTINATION lib)
install(FILES ${SRCNAME}.h ${INCLUDEFILES} DESTINATION include/${SRCNAME})
install(FILES ${INCLUDEFILES} DESTINATION include/${SRCNAME})
install(PROGRAMS ${SCRIPTFILES} DESTINATION bin)