Skip to content

Commit 5d7e0dd

Browse files
committed
Use luabind.cmake instead of luabind/CMakeLists.txt. luabind now depends on Externals/luajit
1 parent 4a32a75 commit 5d7e0dd

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

Externals/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
add_subdirectory(luajit)
2-
add_subdirectory(luabind)
2+
include(luabind.cmake)
3+
#add_subdirectory(luabind)
34
add_subdirectory(lzo)
45
add_subdirectory(cximage)
56
add_subdirectory(NVTT)

Externals/luabind.cmake

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project(luabind)
3+
4+
option(LUABIND_BUILD_TESTING "Build luabind testing" OFF)
5+
option(LUABIND_BUILD_SHARED "Build luabind as a shared library?" ON)
6+
7+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake")
8+
9+
if(BUILD_DEPENDS)
10+
add_subdirectory(luajit ${CMAKE_BINARY_DIR}/Externals/luajit)
11+
else()
12+
link_directories(${CMAKE_BINARY_DIR}/Externals/luajit)
13+
endif()
14+
#if(BUILD_DEPENDS)
15+
# add_subdirectory(platform/cmake/LuaJIT ${CMAKE_BINARY_DIR}/LuaJIT)
16+
#else()
17+
# link_directories(dependencies/LuaJIT/build/)
18+
#endif()
19+
20+
if(MSVC)
21+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
22+
endif()
23+
24+
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
25+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive")
26+
endif()
27+
28+
if(LUABIND_BUILD_SHARED)
29+
add_definitions(-DLUABIND_DYNAMIC_LINK)
30+
endif()
31+
32+
add_definitions(-DNDEBUG) #TODO: Add toggle for debug mode
33+
34+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
35+
${LUA_INCLUDE_DIR}
36+
luabind
37+
)
38+
39+
add_subdirectory(luabind/src)
40+
41+
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
42+
if(LUABIND_BUILD_TESTING)
43+
add_subdirectory(luabind/test)
44+
endif()
45+
add_subdirectory(luabind/doc)
46+
endif()

0 commit comments

Comments
 (0)