blob: ff5dc927cdcc28ac70bb088fce0af0cc11585f04 (
plain) (
tree)
|
|
cmake_minimum_required (VERSION 2.6)
project (lua)
include_directories ("${PROJECT_SOURCE_DIR}/../../src/")
file(GLOB SOURCE
"src/*.c"
)
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})
else()
add_library(lua ${SOURCE})
endif()
# Tell Lua what dynamic loader to use (for LuaRocks):
if (UNIX)
if (APPLE)
add_definitions(-DLUA_USE_MACOSX)
else()
add_definitions(-DLUA_USE_LINUX)
endif ()
endif()
if (UNIX)
target_link_libraries(lua m ${DYNAMIC_LOADER})
endif()
|