Skip to content

Commit

Permalink
* #213
Browse files Browse the repository at this point in the history
  • Loading branch information
adamansky committed Mar 11, 2019
1 parent 94dc939 commit dd342d4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
5 changes: 5 additions & 0 deletions hints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


#Prerequisites

apt-get install libuv1-dev libcunit1-dev
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if (NOT CMAKE_BUILD_TYPE)
message(FATAL_ERROR "Please specify the build type -DCMAKE_BUILD_TYPE=Debug|Release|RelWithDebInfo")
endif()

set(MODULES util jbl jql jbrest)
set(MODULES util jbl jql jbr)
set(PROJECT_LLIBRARIES)
set(PROJECT_INCLUDE_DIRS)
set(ALL_SRC)
Expand Down Expand Up @@ -97,7 +97,9 @@ foreach(MODULE IN LISTS MODULES)
endforeach(MODULE)

list(APPEND PUB_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/ejdb2.h
${CMAKE_CURRENT_SOURCE_DIR}/jbi/jbi.h)
${CMAKE_CURRENT_SOURCE_DIR}/jbl/jbl.h
${CMAKE_CURRENT_SOURCE_DIR}/jbr/jbr.h
${CMAKE_CURRENT_SOURCE_DIR}/jql/jql.h)

list(REMOVE_DUPLICATES PROJECT_LLIBRARIES)
list(REMOVE_DUPLICATES PROJECT_INCLUDE_DIRS)
Expand Down
49 changes: 47 additions & 2 deletions src/jbr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
include(ExternalProject)

set(LWS_SOURCE_DIR "${CMAKE_BINARY_DIR}/src/extern_lws")
set(LWS_BINARY_DIR "${CMAKE_BINARY_DIR}/lws")
set(LWS_INCLUDE_DIR "${LWS_BINARY_DIR}/include")
set(LWS_LIBRARY_DIR "${LWS_BINARY_DIR}/lib")

#ExternalProject_Add(
#)
ExternalProject_Add(
extern_lws
GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git
GIT_TAG v3.1.0
PREFIX ${CMAKE_BINARY_DIR}
BUILD_IN_SOURCE ON
GIT_PROGRESS ON
UPDATE_COMMAND ""
UPDATE_DISCONNECTED ON
LOG_DOWNLOAD OFF
LOG_UPDATE OFF
LOG_BUILD OFF
LOG_CONFIGURE OFF
LOG_INSTALL OFF
BUILD_BYPRODUCTS "${LWS_LIBRARY_DIR}/libwebsockets.a"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/lws
-DLWS_WITHOUT_CLIENT=ON
-DLWS_WITHOUT_TEST_CLIENT=ON
-DLWS_WITHOUT_TEST_PING=ON
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON
-DLWS_WITHOUT_TEST_SERVER=ON
-DLWS_WITHOUT_TESTAPPS=ON
-DLWS_ROLE_H1=ON
-DLWS_ROLE_WS=ON
-DLWS_WITH_LIBUV=ON
-DLWS_WITH_SSL=OFF
-DLWS_WITH_SHARED=OFF
)

add_library(websockets_s STATIC IMPORTED GLOBAL)
set_target_properties(
websockets_s
PROPERTIES
IMPORTED_LOCATION "${LWS_LIBRARY_DIR}/libwebsockets.a"
)
add_dependencies(websockets_s extern_lws)

list(APPEND PROJECT_LLIBRARIES websockets_s)
list(APPEND PROJECT_INCLUDE_DIRS ${LWS_INCLUDE_DIR})
set(PROJECT_LLIBRARIES "${PROJECT_LLIBRARIES}" PARENT_SCOPE)
set(PROJECT_INCLUDE_DIRS "${PROJECT_INCLUDE_DIRS}" PARENT_SCOPE)

0 comments on commit dd342d4

Please sign in to comment.