-
Notifications
You must be signed in to change notification settings - Fork 1.7k
http_client_asio based on Botan's TLS implementation #1110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,90 @@ | ||
function(cpprest_find_botan) | ||
if(TARGET cpprestsdk_botan_internal) | ||
return() | ||
endif() | ||
|
||
INCLUDE (FindPackageHandleStandardArgs) | ||
|
||
SET (_BOTAN_POSSIBLE_DIRS ${BOTAN_ROOT_DIR}) | ||
|
||
IF (WIN32) | ||
SET (_BOTAN_POSSIBLE_DIRS ${_BOTAN_POSSIBLE_DIRS} "C:\\usr\\local" "C:\\usr") | ||
ENDIF (WIN32) | ||
|
||
# Note: after 1.11.34, botan library moved to semantic versioning (a.k.a. 2.0) | ||
SET (_BOTAN_POSSIBLE_INCLUDE_SUFFIXES include include/botan-1.10 include/botan-1.11 include/botan-2.0 include/botan-2) | ||
SET (_BOTAN_POSSIBLE_LIB_SUFFIXES lib) | ||
|
||
FIND_PATH (BOTAN_ROOT_DIR | ||
NAMES botan/botan.h | ||
PATHS ${_BOTAN_POSSIBLE_DIRS} | ||
PATH_SUFFIXES ${_BOTAN_POSSIBLE_INCLUDE_SUFFIXES} | ||
DOC "Botan root directory") | ||
|
||
FIND_PATH (BOTAN_INCLUDE_DIR | ||
NAMES botan/botan.h | ||
PATHS ${BOTAN_ROOT_DIR} | ||
PATH_SUFFIXES ${_BOTAN_POSSIBLE_INCLUDE_SUFFIXES} | ||
DOC "Botan include directory") | ||
|
||
FIND_LIBRARY (BOTAN_LIBRARY_DEBUG | ||
NAMES botand botand-1.10 botand-1.11 botand-2 | ||
PATHS ${_BOTAN_POSSIBLE_DIRS} | ||
PATH_SUFFIXES ${_BOTAN_POSSIBLE_LIB_SUFFIXES} | ||
DOC "Botan debug library") | ||
|
||
FIND_LIBRARY (BOTAN_LIBRARY_RELEASE | ||
NAMES botan botan-1.10 botan-1.11 botan-2 | ||
PATHS ${_BOTAN_POSSIBLE_DIRS} | ||
PATH_SUFFIXES ${_BOTAN_POSSIBLE_LIB_SUFFIXES} | ||
DOC "Botan release library") | ||
|
||
IF (NOT DEFINED BOTAN_LIBRARIES) | ||
IF (BOTAN_LIBRARY_DEBUG AND BOTAN_LIBRARY_RELEASE) | ||
SET (BOTAN_LIBRARIES | ||
optimized ${BOTAN_LIBRARY_RELEASE} | ||
debug ${BOTAN_LIBRARY_DEBUG}) | ||
ELSEIF (BOTAN_LIBRARY_RELEASE) | ||
SET (BOTAN_LIBRARIES ${BOTAN_LIBRARY_RELEASE}) | ||
ENDIF (BOTAN_LIBRARY_DEBUG AND BOTAN_LIBRARY_RELEASE) | ||
ENDIF (NOT DEFINED BOTAN_LIBRARIES) | ||
|
||
IF (BOTAN_INCLUDE_DIR) | ||
SET (BOTAN_INCLUDE_DIRS ${BOTAN_INCLUDE_DIR}) | ||
|
||
SET (_BOTAN_VERSION_HEADER ${BOTAN_INCLUDE_DIR}/botan/build.h) | ||
|
||
IF (EXISTS ${_BOTAN_VERSION_HEADER}) | ||
FILE (STRINGS ${_BOTAN_VERSION_HEADER} _BOTAN_VERSION_TMP REGEX | ||
"#define BOTAN_VERSION_(MAJOR|MINOR|PATCH)[ \t]+[0-9]+") | ||
|
||
STRING (REGEX REPLACE | ||
".*#define BOTAN_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" BOTAN_VERSION_MAJOR | ||
${_BOTAN_VERSION_TMP}) | ||
STRING (REGEX REPLACE | ||
".*#define BOTAN_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" BOTAN_VERSION_MINOR | ||
${_BOTAN_VERSION_TMP}) | ||
STRING (REGEX REPLACE | ||
".*#define BOTAN_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" BOTAN_VERSION_PATCH | ||
${_BOTAN_VERSION_TMP}) | ||
|
||
SET (BOTAN_VERSION_COUNT 3) | ||
SET (BOTAN_VERSION | ||
${BOTAN_VERSION_MAJOR}.${BOTAN_VERSION_MINOR}.${BOTAN_VERSION_PATCH}) | ||
ENDIF (EXISTS ${_BOTAN_VERSION_HEADER}) | ||
ENDIF (BOTAN_INCLUDE_DIR) | ||
|
||
MARK_AS_ADVANCED (BOTAN_ROOT_DIR BOTAN_INCLUDE_DIR BOTAN_LIBRARY_DEBUG | ||
BOTAN_LIBRARY_RELEASE) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (Botan REQUIRED_VARS BOTAN_INCLUDE_DIRS | ||
BOTAN_LIBRARIES VERSION_VAR BOTAN_VERSION) | ||
|
||
add_library(Botan INTERFACE) | ||
target_include_directories(Botan INTERFACE ${BOTAN_INCLUDE_DIR}) | ||
target_link_libraries(Botan INTERFACE ${BOTAN_LIBRARIES}) | ||
|
||
add_library(cpprestsdk_botan_internal INTERFACE) | ||
target_link_libraries(cpprestsdk_botan_internal INTERFACE "$<BUILD_INTERFACE:${BOTAN_LIBRARY}>") | ||
target_include_directories(cpprestsdk_botan_internal INTERFACE "$<BUILD_INTERFACE:${BOTAN_INCLUDE_DIR}>") | ||
endfunction() |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.