Skip to content

Commit

Permalink
Use luabind.cmake instead of luabind/CMakeLists.txt. luabind now depe…
Browse files Browse the repository at this point in the history
…nds on Externals/luajit
  • Loading branch information
q4a committed May 25, 2018
1 parent 4a32a75 commit 5d7e0dd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Externals/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory(luajit)
add_subdirectory(luabind)
include(luabind.cmake)
#add_subdirectory(luabind)
add_subdirectory(lzo)
add_subdirectory(cximage)
add_subdirectory(NVTT)
Expand Down
46 changes: 46 additions & 0 deletions Externals/luabind.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 2.8)
project(luabind)

option(LUABIND_BUILD_TESTING "Build luabind testing" OFF)
option(LUABIND_BUILD_SHARED "Build luabind as a shared library?" ON)

set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake")

if(BUILD_DEPENDS)
add_subdirectory(luajit ${CMAKE_BINARY_DIR}/Externals/luajit)
else()
link_directories(${CMAKE_BINARY_DIR}/Externals/luajit)
endif()
#if(BUILD_DEPENDS)
# add_subdirectory(platform/cmake/LuaJIT ${CMAKE_BINARY_DIR}/LuaJIT)
#else()
# link_directories(dependencies/LuaJIT/build/)
#endif()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive")
endif()

if(LUABIND_BUILD_SHARED)
add_definitions(-DLUABIND_DYNAMIC_LINK)
endif()

add_definitions(-DNDEBUG) #TODO: Add toggle for debug mode

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${LUA_INCLUDE_DIR}
luabind
)

add_subdirectory(luabind/src)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
if(LUABIND_BUILD_TESTING)
add_subdirectory(luabind/test)
endif()
add_subdirectory(luabind/doc)
endif()

0 comments on commit 5d7e0dd

Please sign in to comment.