-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (33 loc) · 1.09 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
cmake_minimum_required(VERSION 3.2)
project(spn)
#
# build soundplaneclient
#
set(SPC_SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/soundplaneclient")
add_subdirectory("${SPC_SOURCE_DIR}")
#
# build spn module
#
add_subdirectory(src)
# packaging for the mod (this could be much improved)
set(MOD_OUTPUT_PATH "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}")
add_custom_target(copy-mod ALL COMMAND
${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/mod
${MOD_OUTPUT_PATH}
)
add_custom_target(copy-extension ALL COMMAND
${CMAKE_COMMAND} -E copy $<TARGET_FILE:lua-extension> "${MOD_OUTPUT_PATH}/lib/"
)
add_dependencies(copy-extension copy-mod)
add_custom_target(install-zip COMMAND
${CMAKE_COMMAND} -E tar "cfv" "${MOD_OUTPUT_PATH}.zip" --format=zip
"${MOD_OUTPUT_PATH}"
)
add_dependencies(install-zip copy-extension copy-mod)
add_custom_target(install-dust COMMAND
${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}
"/home/we/dust/code/${CMAKE_PROJECT_NAME}"
)
add_dependencies(install-dust copy-extension copy-mod)