Cleaned up the CyaSSL linking in the CMake project a bit. 09/3009/1
authorJoakim Söderberg <joakim.soderberg@gmail.com>
Wed, 6 Feb 2013 06:30:56 +0000 (15:30 +0900)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:31 +0000 (13:01 -0800)
Separated the CyaSSL linking and OpenSSL linking for more clearity.
Now tested on both OSX and Windows as well.

CMakeLists.txt

index 6baaf91..cd9d1b0 100644 (file)
@@ -327,20 +327,22 @@ if (WITH_SSL)
 
        if (USE_CYASSL)
                # Use CyaSSL as OpenSSL replacement.
-               set(OPENSSL_LIBRARIES ${CYASSL_LIB})
-               set(OPENSSL_INCLUDE_DIR ${CYASSL_INCLUDE_DIRS})
-               set(OPENSSL_FOUND 1)
+               # TODO: Add a find_package command for this also.
+               message("CyaSSL include dir: ${CYASSL_INCLUDE_DIRS}")
+               message("CyaSSL libraries: ${CYASSL_LIB}")
+
+               include_directories(${CYASSL_INCLUDE_DIRS})
+               target_link_libraries(websockets ${CYASSL_LIB})
        else()
                # TODO: Add support for STATIC also.
                find_package(OpenSSL REQUIRED)
 
-               # TODO: Find OpenSSL binaries and copy them to the output directories for the test-apps so that they can be run out of the box.
-       endif()
+               message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
+               message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
 
-       message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
-       message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
-       include_directories(${OPENSSL_INCLUDE_DIR})
-       target_link_libraries(websockets ${OPENSSL_LIBRARIES})
+               include_directories(${OPENSSL_INCLUDE_DIR})
+               target_link_libraries(websockets ${OPENSSL_LIBRARIES})
+       endif()
 endif(WITH_SSL)
 
 #