Skip to content

Commit

Permalink
Add OpenSSL/Websocketpp dependencies to CMake build
Browse files Browse the repository at this point in the history
  • Loading branch information
jrogers committed Apr 6, 2016
1 parent b45033d commit 650acaf
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 44 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -29,8 +29,10 @@ set(CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake/Modules/")

find_package(Boost REQUIRED COMPONENTS program_options system thread)
find_package(Libmsgpack REQUIRED)
find_package(Websocketpp REQUIRED)
find_package(Msgpack REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)

set(PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/autobahn.hpp
Expand Down
41 changes: 0 additions & 41 deletions cmake/Modules/FindLibmsgpack.cmake

This file was deleted.

24 changes: 24 additions & 0 deletions cmake/Modules/FindMsgpack.cmake
@@ -0,0 +1,24 @@
# - Try to find msgpack
# Once done this will define
# Msgpack_FOUND - System has msgpack
# Msgpack_INCLUDE_DIRS - The msgpack include directories

find_package(PkgConfig QUIET)

if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_MSGPACK QUIET msgpack)
endif (PKG_CONFIG_FOUND)

find_path(Msgpack_INCLUDE_DIR msgpack.hpp
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS})

set(Msgpack_INCLUDE_DIRS ${Msgpack_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set Msgpack_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Msgpack DEFAULT_MSG
Msgpack_INCLUDE_DIR
Msgpack_INCLUDE_DIRS)

mark_as_advanced(Msgpack_INCLUDE_DIR)
24 changes: 24 additions & 0 deletions cmake/Modules/FindWebsocketpp.cmake
@@ -0,0 +1,24 @@
# - Try to find websocketpp
# Once done this will define
# Websocketpp_FOUND - System has websocketpp
# Websocketpp_INCLUDE_DIRS - The websocketpp include directories

find_package(PkgConfig QUIET)

if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_WEBSOCKETPP QUIET websocketpp)
endif (PKG_CONFIG_FOUND)

find_path(Websocketpp_INCLUDE_DIR websocketpp
HINTS ${PC_WEBSOCKETPP_INCLUDEDIR} ${PC_WEBSOCKETPP_INCLUDE_DIRS})

set(Websocketpp_INCLUDE_DIRS ${Websocketpp_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set Websocketpp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Websocketpp DEFAULT_MSG
Websocketpp_INCLUDE_DIR
Websocketpp_INCLUDE_DIRS)

mark_as_advanced(Websocketpp_INCLUDE_DIR)
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
@@ -1,5 +1,5 @@
include_directories(${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${Libmsgpack_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
include_directories(${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${Websocketpp_INCLUDE_DIRS} ${Msgpack_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

set(PARAMETERS_SOURCES parameters.cpp)
set(PARAMETERS_HEADERS parameters.hpp)
Expand Down

0 comments on commit 650acaf

Please sign in to comment.