lua cmake

cmake_minimum_required(VERSION 2.8)
project (LUA C)

# the following two variables are defined for the use of packages
# that wish to link or compile against lua
set (LUA_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
set (LUA_LIBRARIES lua)

add_subdirectory (src)


------------------------------------------------

#----------------------------------------------------
#-- lua/src/CMakeLists.txt
#---------------------------------------------------
# define the lua core source files
set (LUA_CORE_SRCS lapi.c lcode.c ldebug.c ldo.c ldump.c
     lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c
     lparser.c lstate.c lstring.c ltable.c ltm.c  lundump.c
     lvm.c lzio.c)

# define the lua lib source files
set (LUA_LIB_SRCS lauxlib.c lbaselib.c ldblib.c liolib.c
     lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c)

# create the library
add_library (lua ${LUA_LIB_SRCS} ${LUA_CORE_SRCS})

# create the lue executable and link it to the lib
add_executable (luaexec lua.c)
target_link_libraries (luaexec lua)

# name the executable lua just like the library
set_target_properties(luaexec PROPERTIES OUTPUT_NAME lua)

# create the luac thing (I have no clue) and link it
add_executable (luac luac.c print.c)
target_link_libraries (luac lua)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值