Merge remote-tracking branch 'remotes/origin/lua' into pip_2
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)
|
||||
@@ -122,7 +124,6 @@ endif()
|
||||
list(APPEND HDRS "${CMAKE_CURRENT_BINARY_DIR}/piversion.h")
|
||||
message(STATUS "Building PIP version ${PIP_VERSION} (${PIP_LIB_TYPE})")
|
||||
|
||||
|
||||
if(MINGW)
|
||||
find_package(MinGW REQUIRED)
|
||||
list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIB})
|
||||
@@ -179,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})
|
||||
@@ -216,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)
|
||||
@@ -614,11 +618,35 @@ if (NOT CROSSTOOLS)
|
||||
list(APPEND PIP_LIBS_TARGETS pip_cloud)
|
||||
endif()
|
||||
|
||||
# Check Lua support
|
||||
if(MINGW)
|
||||
set(LUA_INCLUDE_DIR ${MINGW_INCLUDE})
|
||||
endif()
|
||||
find_package(Lua QUIET)
|
||||
if (LUA_FOUND)
|
||||
message(STATUS "Building PIP with Lua support")
|
||||
import_version(pip_lua pip)
|
||||
set_deploy_property(pip_lua ${PIP_LIB_TYPE}
|
||||
LABEL "PIP Lua support"
|
||||
FULLNAME "${_PIP_DOMAIN}.pip_lua"
|
||||
COMPANY "${_PIP_COMPANY}"
|
||||
INFO "Platform-Independent Primitives")
|
||||
make_rc(pip_lua _RC)
|
||||
add_definitions(-DPIP_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
|
||||
if(PIP_UTILS)
|
||||
add_executable(pip_test "main.cpp")
|
||||
target_link_libraries(pip_test pip)
|
||||
if (LUA_FOUND)
|
||||
target_link_libraries(pip_test pip_lua ${LUA_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else()
|
||||
@@ -650,6 +678,10 @@ if(LIB)
|
||||
if(MINGW)
|
||||
if (NOT CROSSTOOLS)
|
||||
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
install(FILES ${HDRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
if(HDR_DIRS)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION ${MINGW_INCLUDE}/pip)
|
||||
endif()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} ARCHIVE DESTINATION ${MINGW_LIB})
|
||||
endif()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} RUNTIME DESTINATION ${MINGW_BIN})
|
||||
@@ -668,6 +700,9 @@ if(LIB)
|
||||
else()
|
||||
if (NOT CROSSTOOLS)
|
||||
install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||
if(HDR_DIRS)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||
endif()
|
||||
endif()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
endif()
|
||||
@@ -683,6 +718,9 @@ else()
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} DESTINATION lib)
|
||||
endif()
|
||||
install(FILES ${HDRS} DESTINATION include/pip)
|
||||
if(HDR_DIRS)
|
||||
install(DIRECTORY ${HDR_DIRS} DESTINATION include/pip)
|
||||
endif()
|
||||
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user