-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
50 lines (37 loc) · 1.58 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
cmake_minimum_required(VERSION 3.8)
PROJECT(dmlua)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModuleImport.cmake)
INCLUDE(cmake/ModuleCompileOptions.cmake)
INCLUDE(cmake/LuaModule.cmake)
ModuleSetCompileOptions()
ModuleSetWinCompilerFlags()
SET(LUA_MODULE lua54)
ADD_DEFINITIONS(-DLUA_COMPAT_MODULE -DLUA_COMPAT_APIINTCASTS)
ShowEnvironment()
LuaModuleImport("${LUA_MODULE}" "libtolua" "src/libtolua" "")
ExeImport("tool" "${LUA_MODULE};libtolua")
ExeImport("samples" "${LUA_MODULE};libtolua")
IF (WIN32)
ADD_CUSTOM_COMMAND(
TARGET dmluademo
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${LUA_MODULE}> ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:libtolua> ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:toluapp> ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script
)
ADD_CUSTOM_COMMAND(
TARGET dmluademo
PRE_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script/toluapp.exe -t -n interface -o interface.cpp -H interface.h interface.pkg
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/samples/dmluademo/script/interface.pkg
)
ADD_CUSTOM_COMMAND(
TARGET dmluademo
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/config/lua_dkm_debug.json
$<TARGET_FILE_DIR:dmluademo>
)
ENDIF(WIN32)