-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
- Loading branch information
Jianhui Zhao
committed
Sep 7, 2018
1 parent
9d4c115
commit 59e7f85
Showing
21 changed files
with
2,125 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
if(CYASSL_PREFER_STATIC_LIB) | ||
set(CYASSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
if(WIN32) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
else() | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
endif() | ||
endif() | ||
|
||
if(UNIX) | ||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(_WOLFSSL QUIET wolfssl) | ||
endif() | ||
|
||
find_path(WOLFSSL_INCLUDE_DIR NAMES wolfssl/version.h HINTS ${_WOLFSSL_INCLUDEDIR}) | ||
find_library(WOLFSSL_LIBRARY NAMES wolfssl HINTS ${_WOLFSSL_LIBDIR}) | ||
if(WOLFSSL_INCLUDE_DIR AND WOLFSSL_LIBRARY) | ||
set(CYASSL_INCLUDE_DIR ${WOLFSSL_INCLUDE_DIR}) | ||
set(CYASSL_LIBRARY ${WOLFSSL_LIBRARY}) | ||
set(CYASSL_VERSION ${_WOLFSSL_VERSION}) | ||
set(CYASSL_IS_WOLFSSL ON) | ||
else() | ||
if(UNIX) | ||
pkg_check_modules(_CYASSL QUIET cyassl) | ||
endif() | ||
|
||
find_path(CYASSL_INCLUDE_DIR NAMES cyassl/version.h HINTS ${_CYASSL_INCLUDEDIR}) | ||
find_library(CYASSL_LIBRARY NAMES cyassl HINTS ${_CYASSL_LIBDIR}) | ||
set(CYASSL_VERSION ${_CYASSL_VERSION}) | ||
set(CYASSL_IS_WOLFSSL OFF) | ||
endif() | ||
|
||
if(NOT CYASSL_VERSION AND CYASSL_INCLUDE_DIR) | ||
if(CYASSL_IS_WOLFSSL) | ||
file(STRINGS "${CYASSL_INCLUDE_DIR}/wolfssl/version.h" CYASSL_VERSION_STR REGEX "^#define[\t ]+LIBWOLFSSL_VERSION_STRING[\t ]+\"[^\"]+\"") | ||
else() | ||
file(STRINGS "${CYASSL_INCLUDE_DIR}/cyassl/version.h" CYASSL_VERSION_STR REGEX "^#define[\t ]+LIBCYASSL_VERSION_STRING[\t ]+\"[^\"]+\"") | ||
endif() | ||
if(CYASSL_VERSION_STR MATCHES "\"([^\"]+)\"") | ||
set(CYASSL_VERSION "${CMAKE_MATCH_1}") | ||
endif() | ||
endif() | ||
|
||
set(CYASSL_INCLUDE_DIRS ${CYASSL_INCLUDE_DIR}) | ||
set(CYASSL_LIBRARIES ${CYASSL_LIBRARY}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(CyaSSL | ||
REQUIRED_VARS | ||
CYASSL_LIBRARY | ||
CYASSL_INCLUDE_DIR | ||
VERSION_VAR | ||
CYASSL_VERSION | ||
) | ||
|
||
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY CYASSL_INCLUDE_DIR CYASSL_LIBRARY) | ||
|
||
if(CYASSL_PREFER_STATIC_LIB) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CYASSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
unset(CYASSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# - Try to find libev | ||
# Once done this will define | ||
# LIBEV_FOUND - System has libev | ||
# LIBEV_INCLUDE_DIR - The libev include directories | ||
# LIBEV_LIBRARY - The libraries needed to use libev | ||
|
||
find_path(LIBEV_INCLUDE_DIR ev.h) | ||
find_library(LIBEV_LIBRARY ev PATH_SUFFIXES lib64) | ||
|
||
if(LIBEV_INCLUDE_DIR) | ||
file(STRINGS "${LIBEV_INCLUDE_DIR}/ev.h" | ||
LIBEV_VERSION_MAJOR REGEX "^#define[ \t]+EV_VERSION_MAJOR[ \t]+[0-9]+") | ||
file(STRINGS "${LIBEV_INCLUDE_DIR}/ev.h" | ||
LIBEV_VERSION_MINOR REGEX "^#define[ \t]+EV_VERSION_MINOR[ \t]+[0-9]+") | ||
string(REGEX REPLACE "[^0-9]+" "" LIBEV_VERSION_MAJOR "${LIBEV_VERSION_MAJOR}") | ||
string(REGEX REPLACE "[^0-9]+" "" LIBEV_VERSION_MINOR "${LIBEV_VERSION_MINOR}") | ||
set(LIBEV_VERSION "${LIBEV_VERSION_MAJOR}.${LIBEV_VERSION_MINOR}") | ||
unset(LIBEV_VERSION_MINOR) | ||
unset(LIBEV_VERSION_MAJOR) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LIBEV_FOUND to TRUE | ||
# if all listed variables are TRUE and the requested version matches. | ||
find_package_handle_standard_args(Libev REQUIRED_VARS | ||
LIBEV_LIBRARY LIBEV_INCLUDE_DIR | ||
VERSION_VAR LIBEV_VERSION) | ||
|
||
mark_as_advanced(LIBEV_INCLUDE_DIR LIBEV_LIBRARY) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h) | ||
|
||
find_library(MBEDTLS_LIBRARY mbedtls) | ||
find_library(MBEDX509_LIBRARY mbedx509) | ||
find_library(MBEDCRYPTO_LIBRARY mbedcrypto) | ||
|
||
if(MBEDTLS_INCLUDE_DIR) | ||
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" | ||
MBEDTLS_VERSION_MAJOR REGEX "^#define[ \t]+MBEDTLS_VERSION_MAJOR[ \t]+[0-9]+") | ||
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" | ||
MBEDTLS_VERSION_MINOR REGEX "^#define[ \t]+MBEDTLS_VERSION_MINOR[ \t]+[0-9]+") | ||
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" | ||
MBEDTLS_VERSION_PATCH REGEX "^#define[ \t]+MBEDTLS_VERSION_PATCH[ \t]+[0-9]+") | ||
string(REGEX REPLACE "[^0-9]+" "" MBEDTLS_VERSION_MAJOR "${MBEDTLS_VERSION_MAJOR}") | ||
string(REGEX REPLACE "[^0-9]+" "" MBEDTLS_VERSION_MINOR "${MBEDTLS_VERSION_MINOR}") | ||
string(REGEX REPLACE "[^0-9]+" "" MBEDTLS_VERSION_PATCH "${MBEDTLS_VERSION_PATCH}") | ||
set(MBEDTLS_VERSION "${MBEDTLS_VERSION_MAJOR}.${MBEDTLS_VERSION_MINOR}.${MBEDTLS_VERSION_PATCH}") | ||
unset(MBEDTLS_VERSION_MINOR) | ||
unset(MBEDTLS_VERSION_MAJOR) | ||
unset(MBEDTLS_VERSION_PATCH) | ||
endif() | ||
|
||
set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}") | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(MbedTLS | ||
REQUIRED_VARS | ||
MBEDTLS_LIBRARY | ||
MBEDX509_LIBRARY | ||
MBEDCRYPTO_LIBRARY | ||
MBEDTLS_INCLUDE_DIR | ||
VERSION_VAR | ||
MBEDTLS_VERSION | ||
) | ||
|
||
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.