2013-12-18 18:14:11 -05:00
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
project (lua)
|
|
|
|
|
|
|
|
include_directories ("${PROJECT_SOURCE_DIR}/../../src/")
|
|
|
|
|
|
|
|
file(GLOB SOURCE
|
2013-12-18 18:54:55 -05:00
|
|
|
"src/*.c"
|
2013-12-18 18:14:11 -05:00
|
|
|
)
|
|
|
|
|
2013-12-27 05:51:08 -05:00
|
|
|
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.c" "${PROJECT_SOURCE_DIR}/src/luac.c")
|
|
|
|
|
|
|
|
# add headers to MSVC project files:
|
|
|
|
if (WIN32)
|
|
|
|
file(GLOB HEADERS "src/*.h")
|
|
|
|
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.h" "${PROJECT_SOURCE_DIR}/src/luac.h")
|
|
|
|
set(SOURCE ${SOURCE} ${HEADERS})
|
|
|
|
source_group("Sources" FILES ${SOURCE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work
|
|
|
|
if (WIN32)
|
|
|
|
add_library(lua SHARED ${SOURCE})
|
2013-12-20 10:29:34 -05:00
|
|
|
else()
|
2013-12-27 05:51:08 -05:00
|
|
|
add_library(lua ${SOURCE})
|
2013-12-20 10:29:34 -05:00
|
|
|
endif()
|
2013-12-18 18:14:11 -05:00
|
|
|
|
2013-12-27 05:51:08 -05:00
|
|
|
if (UNIX)
|
2013-12-27 05:56:39 -05:00
|
|
|
target_link_libraries(lua m dl)
|
2013-12-21 08:50:32 -05:00
|
|
|
endif()
|