PIP Lua Module
This commit is contained in:
@@ -67,6 +67,7 @@ set(PIP_SRC_OPENCL "lib/opencl")
|
||||
set(PIP_SRC_IO_UTILS "lib/io_utils")
|
||||
set(PIP_SRC_CONCURRENT "lib/concurrent")
|
||||
set(PIP_SRC_CLOUD "lib/cloud")
|
||||
set(PIP_SRC_LUA "lib/lua")
|
||||
set(PIP_SRC_DIRS ${PIP_SRC_MAIN}
|
||||
${PIP_SRC_CONSOLE}
|
||||
${PIP_SRC_CRYPT}
|
||||
@@ -83,6 +84,7 @@ set(LIBS_MAIN)
|
||||
set(LIBS_STATUS)
|
||||
set(HDRS)
|
||||
set(PHDRS)
|
||||
set(HDR_DIRS)
|
||||
|
||||
if (TESTS)
|
||||
include(DownloadGTest)
|
||||
@@ -178,7 +180,7 @@ get_filename_component(C_COMPILER "${CMAKE_C_COMPILER}" NAME)
|
||||
# Sources
|
||||
|
||||
# Main lib
|
||||
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io_devices" "io_utils" "console" "math" "code" "geo" "resources" "opencl" "crypt" "introspection" "concurrent" "cloud")
|
||||
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io_devices" "io_utils" "console" "math" "code" "geo" "resources" "opencl" "crypt" "introspection" "concurrent" "cloud" "lua")
|
||||
include_directories("${PIP_SRC_MAIN}")
|
||||
set(PIP_MAIN_FOLDERS)
|
||||
foreach(F ${PIP_FOLDERS})
|
||||
@@ -215,6 +217,9 @@ gather_src("${PIP_CONCURRENT_TEST}" CPP_CONCURRENT_TEST HDRS PHDRS)
|
||||
# Cloud lib
|
||||
gather_src("${PIP_SRC_CLOUD}" CPP_LIB_CLOUD HDRS PHDRS)
|
||||
|
||||
# LUA lib
|
||||
gather_src("${PIP_SRC_LUA}" CPP_LIB_LUA HDRS PHDRS)
|
||||
|
||||
if(PIP_FREERTOS)
|
||||
add_definitions(-DPIP_FREERTOS)
|
||||
set(ICU OFF)
|
||||
@@ -621,7 +626,11 @@ if (NOT CROSSTOOLS)
|
||||
if (LUA_FOUND)
|
||||
message(STATUS "Building PIP with Lua support")
|
||||
add_definitions(-DPIP_LUA)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/lua)
|
||||
include_directories(${LUA_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib/lua/3rd)
|
||||
list(APPEND HDR_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/lib/lua/3rd/LuaBridge")
|
||||
add_library(pip_lua ${PIP_LIB_TYPE} ${CPP_LIB_LUA} ${_RC})
|
||||
target_link_libraries(pip_lua pip ${LUA_LIBRARIES})
|
||||
list(APPEND PIP_LIBS_TARGETS pip_lua)
|
||||
endif()
|
||||
|
||||
# Test program
|
||||
@@ -629,7 +638,7 @@ if (NOT CROSSTOOLS)
|
||||
add_executable(pip_test "main.cpp")
|
||||
target_link_libraries(pip_test pip)
|
||||
if (LUA_FOUND)
|
||||
target_link_libraries(pip_test ${LUA_LIBRARIES})
|
||||
target_link_libraries(pip_test pip_lua ${LUA_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -662,6 +671,8 @@ if(LIB)
|
||||
if(MINGW)
|
||||
if (NOT CROSSTOOLS)
|
||||
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} ARCHIVE DESTINATION ${MINGW_LIB})
|
||||
endif()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} RUNTIME DESTINATION ${MINGW_BIN})
|
||||
@@ -680,6 +691,7 @@ if(LIB)
|
||||
else()
|
||||
if (NOT CROSSTOOLS)
|
||||
install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||
endif()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
endif()
|
||||
@@ -695,6 +707,7 @@ else()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} DESTINATION lib)
|
||||
endif()
|
||||
install(FILES ${HDRS} DESTINATION include/pip)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION include/pip)
|
||||
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user