Skip to content

Commit

Permalink
Merge pull request #200 from smartdevicelink/develop
Browse files Browse the repository at this point in the history
Release 6.1.0
  • Loading branch information
Jack-Byrne authored Apr 29, 2020
2 parents e7b44f3 + 6f0aff7 commit fa9ebe6
Show file tree
Hide file tree
Showing 98 changed files with 7,448 additions and 429 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ user_modules/
sdl.pid
ErrorLog.txt
*.so
build/
ATF
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "modules/json4lua"]
path = modules/json4lua
url = https://github.com/CustomSDL/json4lua
url = https://github.com/smartdevicelink/json4lua
branch = master
45 changes: 45 additions & 0 deletions BSON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_SOURCE_PREFIX ${CMAKE_SOURCE_PREFIX} "${CMAKE_INSTALL_PREFIX}")

find_package (BSON)

if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND" OR ${LUA_BSON_LIB} MATCHES "LUA_BSON_LIB-NOTFOUND")
message (STATUS "Building bson required")
set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib CACHE INTERNAL "Sources of bson library" FORCE)
set(BSON_LIBS_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of bson libraries" FORCE)
set(LUA_BSON_LIBS_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/lua/5.2 CACHE INTERNAL "Installation path of bson libraries" FORCE)
set(BSON_INCLUDE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of bson headers" FORCE)
set(EMHASHMAP_LIBS_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
set(EMHASHMAP_INCLUDE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of emashmap headers" FORCE)

set(BSON_INSTALL_COMMAND make install)
if (${CMAKE_INSTALL_PREFIX} MATCHES "/usr/local")
set(BSON_INSTALL_COMMAND sudo make install)
endif()
set(BSON_CONFIGURE_FLAGS
"--with-lua-wrapper=yes"
"CPPFLAGS=-I${BSON_LIB_SOURCE_DIRECTORY}/src")
include(ExternalProject)
ExternalProject_Add(libbson
GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git"
GIT_TAG "master"
BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY}
SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY}
CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure config.h.in && ./configure ${BSON_CONFIGURE_FLAGS} --prefix=${CMAKE_INSTALL_PREFIX}
BUILD_COMMAND make
INSTALL_COMMAND ${BSON_INSTALL_COMMAND})
else()
get_filename_component(LUA_BSON_LIBS_DIRECTORY ${LUA_BSON_LIB} DIRECTORY)
get_filename_component(BSON_LIBS_DIRECTORY ${BSON_LIB} DIRECTORY)
get_filename_component(EMHASHMAP_LIBS_DIRECTORY ${EMHASHMAP_LIB} DIRECTORY)
message (STATUS "bson installed in: " ${BSON_LIBS_DIRECTORY} " , " ${BSON_INCLUDE_DIRECTORY})
message (STATUS "luabson installed in: " ${LUA_BSON_LIBS_DIRECTORY})
message (STATUS "emhashmap installed in: " ${EMHASHMAP_LIBS_DIRECTORY} " , " ${EMHASHMAP_INCLUDE_DIRECTORY})
set(BSON_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of bson libraries" FORCE)
set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of emashmap libraries" FORCE)
add_custom_target(libbson
DEPENDS ${BSON_LIBS_DIRECTORY}
DEPENDS ${EMHASHMAP_LIBS_DIRECTORY})
endif()
97 changes: 97 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
project(ATF)
cmake_minimum_required(VERSION 3.11)

# Enable PIC as static libraries may be linked to shared objects
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)
# Append directories in the linker search path and outside the project
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin" CACHE PATH "default install path" FORCE )
endif()

#
# Options
#
option(BUILD_TESTS
"Build unit BUILD_TESTS."
OFF)
option(BUILD_WITH_SERVER_LOGGING
"ALlow logging in the library for debug purposes."
ON)
option(BUILD_WITH_CLIENT_LOGGING
"ALlow logging in the library for debug purposes."
OFF)

if(BUILD_TESTS)
enable_testing()
endif()

find_package(Qt5 5.9 COMPONENTS Core Network WebSockets REQUIRED)
find_package(Lua 5.2 EXACT REQUIRED)

list(GET LUA_LIBRARIES 0 LUA_LIB)
list(GET LUA_LIBRARIES 1 LIBM_LIB)

message(STATUS "lualib : ${LUA_LIB}")
message(STATUS "libmlib : ${LIBM_LIB}")

add_library(lua::lua UNKNOWN IMPORTED GLOBAL)
set_target_properties(lua::lua PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
IMPORTED_LOCATION ${LUA_LIB}
IMPORTED_LINK_DEPENDENT_LIBRARIES ${LIBM_LIB})

execute_process(COMMAND git submodule init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(COMMAND git submodule update WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

add_executable(${PROJECT_NAME}
src/network.cc
src/timers.cc
src/qtdynamic.cc
src/qtlua.cc
src/qdatetime.cc
src/marshal.cc
src/main.cc
src/lua_interpreter.cc)

target_link_libraries(${PROJECT_NAME}
Qt5::Core
Qt5::Network
Qt5::WebSockets
lua::lua)

include("BSON.cmake")

install(TARGETS ${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_PREFIX}"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)

install(FILES ${LUA_BSON_LIBS_DIRECTORY}/bson4lua.so
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)

install(DIRECTORY "${CMAKE_SOURCE_DIR}/modules"
"${CMAKE_SOURCE_DIR}/data"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
FILE_PERMISSIONS OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)

install(DIRECTORY "${CMAKE_SOURCE_DIR}/tools"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)

install(FILES "${CMAKE_SOURCE_DIR}/start.sh"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)

add_subdirectory(src/luaxml)
add_subdirectory(src/luaopenssl)
add_subdirectory(src/remote_adapter)
33 changes: 33 additions & 0 deletions FindBSON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
set(INCLUDE_PATH "${CMAKE_SOURCE_PREFIX}/include")
set(LIB_PATH "${CMAKE_SOURCE_PREFIX}/lib")

find_path(BSON_INCLUDE_DIRECTORY bson_object.h bson_array.h bson_util.h
PATHS "${INCLUDE_PATH}")

find_library(BSON_LIB
NAMES bson
PATHS ${LIB_PATH})

set(PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
set(CMAKE_FIND_LIBRARY_PREFIXES ";" ${PREFIXES})
find_library(LUA_BSON_LIB
NAMES bson4lua
PATHS ${LIB_PATH}/lua/5.2)
set(CMAKE_FIND_LIBRARY_PREFIXES ${PREFIXES})

find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h
PATHS ${INCLUDE_PATH}
PATH_SUFFIXES emhashmap)

find_library(EMHASHMAP_LIB
NAMES emhashmap
PATHS ${LIB_PATH})

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB
EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB LUA_BSON_LIB)

mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB)
mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB)
mark_as_advanced(LUA_BSON_LIB)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 - 2018 SmartDeviceLink Consortium, Inc.
Copyright (c) 2017 - 2020 SmartDeviceLink Consortium, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
65 changes: 0 additions & 65 deletions Makefile

This file was deleted.

Loading

0 comments on commit fa9ebe6

Please sign in to comment.