-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
29 lines (24 loc) · 1.05 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
cmake_minimum_required(VERSION 3.5)
project(masterlink)
set(OUTDIR "${CMAKE_SOURCE_DIR}/build")
set(LIBDIR "${OUTDIR}/lib")
set(CFGDIR "${OUTDIR}/data")
set(SCRDIR "${OUTDIR}/scripts")
file(MAKE_DIRECTORY ${OUTDIR})
include(Lua-cURLv3.cmake)
add_subdirectory(lua-cjson)
set_target_properties(cjson lcurl
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${LIBDIR}"
)
add_custom_target(copyMLM)
add_custom_command(TARGET copyMLM PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBDIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CFGDIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SCRDIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBDIR}/lua"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/INSTALL.txt "${OUTDIR}"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/mlapi.lua "${LIBDIR}/lua"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/master.lua "${SCRDIR}"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/master.json "${CFGDIR}"
)