Skip to content

Commit 5bfe36a

Browse files
committed
Initial version
1 parent e949da6 commit 5bfe36a

12 files changed

+1135
-226
lines changed

.travis.yml

+60-64
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,70 @@
1-
os: linux
2-
services:
3-
- docker
4-
sudo: required
5-
language: python
6-
env:
7-
global:
8-
- CONAN_UPLOAD=1
9-
- CONAN_REFERENCE="OpenSSL/1.0.2k"
10-
- CONAN_USERNAME="lasote"
11-
- CONAN_CHANNEL="testing"
12-
- CONAN_TOTAL_PAGES=2
13-
- CONAN_STABLE_BRANCH_PATTERN="release/*"
14-
15-
matrix:
16-
- CONAN_GCC_VERSIONS=4.6 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
17-
- CONAN_GCC_VERSIONS=4.6 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
18-
19-
- CONAN_GCC_VERSIONS=4.8 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
20-
- CONAN_GCC_VERSIONS=4.8 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
21-
22-
- CONAN_GCC_VERSIONS=4.9 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
23-
- CONAN_GCC_VERSIONS=4.9 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
24-
25-
- CONAN_GCC_VERSIONS=5.2 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
26-
- CONAN_GCC_VERSIONS=5.2 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
27-
28-
- CONAN_GCC_VERSIONS=5.3 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
29-
- CONAN_GCC_VERSIONS=5.3 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
30-
31-
- CONAN_GCC_VERSIONS=5.4 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
32-
- CONAN_GCC_VERSIONS=5.4 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
33-
34-
- CONAN_GCC_VERSIONS=6.2 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
35-
- CONAN_GCC_VERSIONS=6.2 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
361

37-
- CONAN_GCC_VERSIONS=6.3 CONAN_CURRENT_PAGE=1 CONAN_USE_DOCKER=1
38-
- CONAN_GCC_VERSIONS=6.3 CONAN_CURRENT_PAGE=2 CONAN_USE_DOCKER=1
2+
env:
3+
global:
4+
- CONAN_REFERENCE: "OpenSSL/1.0.2l"
5+
- CONAN_USERNAME: "conan"
6+
- CONAN_LOGIN_USERNAME: "lasote"
7+
- CONAN_CHANNEL: "testing"
8+
- CONAN_UPLOAD: "https://api.bintray.com/conan/lasote/conan-repo"
9+
- CONAN_STABLE_BRANCH_PATTERN="release/*"
10+
- CONAN_TOTAL_PAGES=2
3911

12+
linux: &linux
13+
os: linux
14+
sudo: required
15+
language: python
16+
python: "3.6"
17+
services:
18+
- docker
19+
osx: &osx
20+
os: osx
21+
language: generic
4022
matrix:
4123
include:
4224

43-
- os: osx
44-
osx_image: xcode8.2 # apple-clang 8.0
45-
language: generic
46-
env: CONAN_CURRENT_PAGE=1
47-
- os: osx
48-
osx_image: xcode8.2 # apple-clang 8.0
49-
language: generic
50-
env: CONAN_CURRENT_PAGE=2
51-
52-
- os: osx
53-
osx_image: xcode7.3 # apple-clang 7.3
54-
language: generic
55-
env: CONAN_CURRENT_PAGE=1
56-
- os: osx
57-
osx_image: xcode7.3 # apple-clang 7.3
58-
language: generic
59-
env: CONAN_CURRENT_PAGE=2
60-
61-
- os: osx
62-
osx_image: xcode6.4 # apple-clang 6.1
63-
language: generic
64-
env: CONAN_CURRENT_PAGE=1
65-
- os: osx
66-
osx_image: xcode6.4 # apple-clang 6.1
67-
language: generic
68-
env: CONAN_CURRENT_PAGE=2
69-
25+
- <<: *linux
26+
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49 CONAN_CURRENT_PAGE=1
27+
- <<: *linux
28+
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49 CONAN_CURRENT_PAGE=2
29+
- <<: *linux
30+
env: CONAN_GCC_VERSIONS=5.4 CONAN_DOCKER_IMAGE=lasote/conangcc54 CONAN_CURRENT_PAGE=1
31+
- <<: *linux
32+
env: CONAN_GCC_VERSIONS=5.4 CONAN_DOCKER_IMAGE=lasote/conangcc54 CONAN_CURRENT_PAGE=2
33+
- <<: *linux
34+
env: CONAN_GCC_VERSIONS=6.3 CONAN_DOCKER_IMAGE=lasote/conangcc63 CONAN_CURRENT_PAGE=1
35+
- <<: *linux
36+
env: CONAN_GCC_VERSIONS=6.3 CONAN_DOCKER_IMAGE=lasote/conangcc63 CONAN_CURRENT_PAGE=2
37+
- <<: *linux
38+
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39 CONAN_CURRENT_PAGE=1
39+
- <<: *linux
40+
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39 CONAN_CURRENT_PAGE=2
41+
- <<: *linux
42+
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40 CONAN_CURRENT_PAGE=1
43+
- <<: *linux
44+
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40 CONAN_CURRENT_PAGE=2
45+
- <<: *osx
46+
osx_image: xcode7.3
47+
env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=1
48+
- <<: *osx
49+
osx_image: xcode7.3
50+
env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=2
51+
- <<: *osx
52+
osx_image: xcode8.2
53+
env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=1
54+
- <<: *osx
55+
osx_image: xcode8.2
56+
env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=2
57+
- <<: *osx
58+
osx_image: xcode8.3
59+
env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=1
60+
- <<: *osx
61+
osx_image: xcode8.3
62+
env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=2
7063

7164
install:
65+
- chmod +x .travis/install.sh
7266
- ./.travis/install.sh
67+
7368
script:
69+
- chmod +x .travis/run.sh
7470
- ./.travis/run.sh

.travis/install.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
1919
pyenv activate conan
2020
fi
2121

22-
pip install conan_package_tools # It install conan too
23-
conan user
22+
pip install conan --upgrade
23+
pip install conan_package_tools
24+
25+
conan user

FindOpenSSL.cmake

+5-108
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,11 @@
1-
#=============================================================================
2-
# Copyright 2006-2009 Kitware, Inc.
3-
# Copyright 2006 Alexander Neundorf <[email protected]>
4-
# Copyright 2009-2011 Mathieu Malaterre <[email protected]>
5-
#
6-
# Distributed under the OSI-approved BSD License (the "License");
7-
# see accompanying file Copyright.txt for details.
8-
#
9-
# This software is distributed WITHOUT ANY WARRANTY; without even the
10-
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11-
# See the License for more information.
12-
#=============================================================================
13-
# (To distribute this file outside of CMake, substitute the full
14-
# License text for the above reference.)
15-
16-
171
MESSAGE(STATUS "********* Conan FindOpenSSL wrapper! **********")
182

193
SET(OPENSSL_ROOT_DIR ${CONAN_OPENSSL_ROOT})
204
SET(OPENSSL_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_OPENSSL})
215

22-
include(FindPackageHandleStandardArgs)
23-
FOREACH(THELIB ${CONAN_LIBS_OPENSSL})
24-
IF(NOT ${THELIB} MATCHES "ssl" AND NOT ${THELIB} MATCHES "crypto")
25-
find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL})
26-
ELSE()
27-
find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL} NO_DEFAULT_PATH)
28-
ENDIF()
29-
30-
IF(${THELIB} MATCHES "ssl")
31-
set(OPENSSL_SSL_LIBRARY ${LIB_${THELIB}})
32-
ENDIF()
33-
IF(${THELIB} MATCHES "crypto")
34-
set(OPENSSL_CRYPTO_LIBRARY ${LIB_${THELIB}})
35-
ENDIF()
36-
IF(NOT ${LIB_${THELIB}} MATCHES "NOTFOUND")
37-
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${LIB_${THELIB}})
38-
ENDIF()
39-
ENDFOREACH()
40-
MESSAGE(${OPENSSL_LIBRARIES})
41-
42-
function(from_hex HEX DEC)
43-
string(TOUPPER "${HEX}" HEX)
44-
set(_res 0)
45-
string(LENGTH "${HEX}" _strlen)
46-
47-
while (_strlen GREATER 0)
48-
math(EXPR _res "${_res} * 16")
49-
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
50-
string(SUBSTRING "${HEX}" 1 -1 HEX)
51-
if (NIBBLE STREQUAL "A")
52-
math(EXPR _res "${_res} + 10")
53-
elseif (NIBBLE STREQUAL "B")
54-
math(EXPR _res "${_res} + 11")
55-
elseif (NIBBLE STREQUAL "C")
56-
math(EXPR _res "${_res} + 12")
57-
elseif (NIBBLE STREQUAL "D")
58-
math(EXPR _res "${_res} + 13")
59-
elseif (NIBBLE STREQUAL "E")
60-
math(EXPR _res "${_res} + 14")
61-
elseif (NIBBLE STREQUAL "F")
62-
math(EXPR _res "${_res} + 15")
63-
else()
64-
math(EXPR _res "${_res} + ${NIBBLE}")
65-
endif()
66-
67-
string(LENGTH "${HEX}" _strlen)
68-
endwhile()
69-
70-
set(${DEC} ${_res} PARENT_SCOPE)
71-
endfunction()
72-
73-
74-
if (OPENSSL_INCLUDE_DIR)
75-
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
76-
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
77-
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])+.*")
78-
79-
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z]).*$"
80-
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
81-
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
82-
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
83-
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
84-
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
85-
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
86-
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
87-
88-
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
89-
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
90-
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
91-
unset(_tmp)
92-
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
93-
endif ()
94-
95-
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
96-
endif ()
97-
endif ()
98-
99-
find_package_handle_standard_args(OpenSSL
100-
REQUIRED_VARS
101-
OPENSSL_LIBRARIES
102-
OPENSSL_INCLUDE_DIR
103-
VERSION_VAR
104-
OPENSSL_VERSION
105-
FAIL_MESSAGE
106-
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
107-
)
108-
1096

110-
mark_as_advanced(
111-
OPENSSL_ROOT_DIR
112-
OPENSSL_INCLUDE_DIR
113-
OPENSSL_LIBRARIES
114-
)
7+
if (DEFINED CMAKE_VERSION AND "${CMAKE_VERSION}" VERSION_LESS "3.7")
8+
include("${CONAN_OPENSSL_ROOT}/FindBoost_less_3.7.cmake")
9+
else()
10+
include("${CONAN_OPENSSL_ROOT}/OriginalFindOpenSSL_3_8.cmake")
11+
endif()

FindOpenSSL_less_3.7.cmake

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#=============================================================================
2+
# Copyright 2006-2009 Kitware, Inc.
3+
# Copyright 2006 Alexander Neundorf <[email protected]>
4+
# Copyright 2009-2011 Mathieu Malaterre <[email protected]>
5+
#
6+
# Distributed under the OSI-approved BSD License (the "License");
7+
# see accompanying file Copyright.txt for details.
8+
#
9+
# This software is distributed WITHOUT ANY WARRANTY; without even the
10+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the License for more information.
12+
#=============================================================================
13+
# (To distribute this file outside of CMake, substitute the full
14+
# License text for the above reference.)
15+
16+
17+
18+
include(FindPackageHandleStandardArgs)
19+
FOREACH(THELIB ${CONAN_LIBS_OPENSSL})
20+
IF(NOT ${THELIB} MATCHES "ssl" AND NOT ${THELIB} MATCHES "crypto")
21+
find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL})
22+
ELSE()
23+
find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL} NO_DEFAULT_PATH)
24+
ENDIF()
25+
26+
IF(${THELIB} MATCHES "ssl")
27+
set(OPENSSL_SSL_LIBRARY ${LIB_${THELIB}})
28+
ENDIF()
29+
IF(${THELIB} MATCHES "crypto")
30+
set(OPENSSL_CRYPTO_LIBRARY ${LIB_${THELIB}})
31+
ENDIF()
32+
IF(NOT ${LIB_${THELIB}} MATCHES "NOTFOUND")
33+
set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${LIB_${THELIB}})
34+
ENDIF()
35+
ENDFOREACH()
36+
MESSAGE(${OPENSSL_LIBRARIES})
37+
38+
function(from_hex HEX DEC)
39+
string(TOUPPER "${HEX}" HEX)
40+
set(_res 0)
41+
string(LENGTH "${HEX}" _strlen)
42+
43+
while (_strlen GREATER 0)
44+
math(EXPR _res "${_res} * 16")
45+
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
46+
string(SUBSTRING "${HEX}" 1 -1 HEX)
47+
if (NIBBLE STREQUAL "A")
48+
math(EXPR _res "${_res} + 10")
49+
elseif (NIBBLE STREQUAL "B")
50+
math(EXPR _res "${_res} + 11")
51+
elseif (NIBBLE STREQUAL "C")
52+
math(EXPR _res "${_res} + 12")
53+
elseif (NIBBLE STREQUAL "D")
54+
math(EXPR _res "${_res} + 13")
55+
elseif (NIBBLE STREQUAL "E")
56+
math(EXPR _res "${_res} + 14")
57+
elseif (NIBBLE STREQUAL "F")
58+
math(EXPR _res "${_res} + 15")
59+
else()
60+
math(EXPR _res "${_res} + ${NIBBLE}")
61+
endif()
62+
63+
string(LENGTH "${HEX}" _strlen)
64+
endwhile()
65+
66+
set(${DEC} ${_res} PARENT_SCOPE)
67+
endfunction()
68+
69+
70+
if (OPENSSL_INCLUDE_DIR)
71+
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
72+
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
73+
REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])+.*")
74+
75+
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z][0-9a-zA-Z])([0-9a-zA-Z]).*$"
76+
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
77+
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
78+
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
79+
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
80+
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
81+
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
82+
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
83+
84+
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
85+
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
86+
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
87+
unset(_tmp)
88+
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
89+
endif ()
90+
91+
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
92+
endif ()
93+
endif ()
94+
95+
find_package_handle_standard_args(OpenSSL
96+
REQUIRED_VARS
97+
OPENSSL_LIBRARIES
98+
OPENSSL_INCLUDE_DIR
99+
VERSION_VAR
100+
OPENSSL_VERSION
101+
FAIL_MESSAGE
102+
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
103+
)
104+
105+
106+
mark_as_advanced(
107+
OPENSSL_ROOT_DIR
108+
OPENSSL_INCLUDE_DIR
109+
OPENSSL_LIBRARIES
110+
)

0 commit comments

Comments
 (0)