Skip to content

Commit

Permalink
Implement conditional cmake configuration for echo_server_tls
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Jul 10, 2013
1 parent 28ac69c commit f6bcb86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
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
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 ()
15 changes: 15 additions & 0 deletions examples/echo_server_tls/CMakeLists.txt
@@ -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()

0 comments on commit f6bcb86

Please sign in to comment.