-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (30 loc) · 1.04 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
set(LIBNAME "milkWFpropagate")
# list source files (.c) other than modulename.c
set(SOURCEFILES
Fresnel_propagate.c
Fresnel_propagate_cube.c
)
# list include files (.h) that should be installed on system
set(INCLUDEFILES
)
# list scripts that should be installed on system
set(SCRIPTFILES
)
# 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("")
message(" SRCNAME = ${SRCNAME} -> LIBNAME = ${LIBNAME}")
project(lib_${LIBNAME}_project)
add_library(${LIBNAME} SHARED ${SRCNAME}.c ${SOURCEFILES})
target_include_directories(${LIBNAME} PUBLIC ${PROJECT_SOURCE_DIR}/..)
target_link_libraries(${LIBNAME} PUBLIC CLIcore)
install(TARGETS ${LIBNAME} DESTINATION lib)
install(FILES ${SRCNAME}.h ${INCLUDEFILES} DESTINATION include/${SRCNAME})
install(PROGRAMS
${SCRIPTFILES}
DESTINATION bin)