Skip to content

Commit

Permalink
Merge pull request XRPLF#274 from hobu/master
Browse files Browse the repository at this point in the history
Implement conditional cmake configuration for echo_server_tls and add cmake config for print_server and telemetry_client
  • Loading branch information
zaphoyd committed Jul 14, 2013
2 parents ddca46f + b83b054 commit d564189
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ if (BUILD_TESTS OR BUILD_EXAMPLES)
else ()
message (FATAL_ERROR "Failed to find required dependency: boost")
endif ()


find_package(OpenSSL)
endif()

############ Add projects
Expand Down
4 changes: 4 additions & 0 deletions cmake/CMakeHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ endmacro ()
macro (link_boost)
target_link_libraries (${TARGET_NAME} ${Boost_LIBRARIES})
endmacro ()

macro (link_openssl)
target_link_libraries (${TARGET_NAME} ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endmacro ()
2 changes: 1 addition & 1 deletion examples/echo_server/echo_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main() {
try {
// Set logging settings
echo_server.set_access_channels(websocketpp::log::alevel::all);
echo_server.clear_access_channels(websocketpp::log::alevel::frame_payload);
// echo_server.clear_access_channels(websocketpp::log::alevel::frame_payload);

// Initialize ASIO
echo_server.init_asio();
Expand Down
15 changes: 15 additions & 0 deletions examples/echo_server_tls/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

file (GLOB SOURCE_FILES *.cpp)
file (GLOB HEADER_FILES *.hpp)


if (OPENSSL_FOUND)

init_target (echo_server_tls)

build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES})

link_boost ()
link_openssl()
final_target ()
endif()
10 changes: 10 additions & 0 deletions examples/print_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

file (GLOB SOURCE_FILES *.cpp)
file (GLOB HEADER_FILES *.hpp)

init_target (print_server)

build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES})

link_boost ()
final_target ()
10 changes: 10 additions & 0 deletions examples/telemetry_client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

file (GLOB SOURCE_FILES *.cpp)
file (GLOB HEADER_FILES *.hpp)

init_target (telemetry_client)

build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES})

link_boost ()
final_target ()

0 comments on commit d564189

Please sign in to comment.