diff --git a/CMakeLists.txt b/CMakeLists.txt index 49824aeb..a9b0783b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/cmake/Modules/FindLibmsgpack.cmake b/cmake/Modules/FindLibmsgpack.cmake deleted file mode 100644 index b7ebafea..00000000 --- a/cmake/Modules/FindLibmsgpack.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# - Try to find libmsgpack -# Once done this will define -# Libmsgpack_FOUND - System has libmsgpack -# Libmsgpack_INCLUDE_DIRS - The libmsgpack include directories -# Libmsgpack_DEFINITIONS - Compiler switches (including include directories) needed for using libmsgpack -# Libmsgpack_LIBRARIES - The libraries needed to use libmsgpack - -find_package(PkgConfig QUIET) - -if(Libmsgpack_USE_STATIC_LIBS) - set( _libmsgpack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) -endif() - -if (PKG_CONFIG_FOUND) - pkg_check_modules(PC_MSGPACK QUIET libmsgpack) -endif (PKG_CONFIG_FOUND) - -find_path(Libmsgpack_INCLUDE_DIR msgpack.hpp - HINTS ${PC_LIBMSGPACK_INCLUDEDIR} ${PC_LIBMSGPACK_INCLUDE_DIRS}) - -find_library(Libmsgpack_LIBRARY NAMES msgpack - HINTS ${PC_MSGPACK_LIBDIR} ${PC_LIBMSGPACK_LIBRARY_DIRS}) - -if(Libmsgpack_USE_STATIC_LIBS) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_libmsgpack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -endif() - -set(Libmsgpack_LIBRARIES ${Libmsgpack_LIBRARY}) -set(Libmsgpack_INCLUDE_DIRS ${Libmsgpack_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set Libmsgpack_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args(Libmsgpack DEFAULT_MSG - Libmsgpack_LIBRARY - Libmsgpack_LIBRARIES - Libmsgpack_INCLUDE_DIR - Libmsgpack_INCLUDE_DIRS) - -mark_as_advanced(Libmsgpack_INCLUDE_DIR Libmsgpack_LIBRARY) diff --git a/cmake/Modules/FindMsgpack.cmake b/cmake/Modules/FindMsgpack.cmake new file mode 100644 index 00000000..b316f2a0 --- /dev/null +++ b/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) diff --git a/cmake/Modules/FindWebsocketpp.cmake b/cmake/Modules/FindWebsocketpp.cmake new file mode 100644 index 00000000..f111004e --- /dev/null +++ b/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) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d501d36e..7314c34a 100644 --- a/examples/CMakeLists.txt +++ b/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)