Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e88f6f47
Commit
e88f6f47
authored
Mar 08, 2017
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12125 Use FIND_PACKAGE(OpenSSL) to find openssl
parent
29a980cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
58 deletions
+12
-58
cmake/ssl.cmake
cmake/ssl.cmake
+12
-58
No files found.
cmake/ssl.cmake
View file @
e88f6f47
...
...
@@ -119,55 +119,19 @@ MACRO (MYSQL_CHECK_SSL)
WITH_SSL STREQUAL
"yes"
OR
WITH_SSL_PATH
)
# First search in WITH_SSL_PATH.
FIND_PATH
(
OPENSSL_ROOT_DIR
NAMES include/openssl/ssl.h
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
HINTS
${
WITH_SSL_PATH
}
)
# Then search in standard places (if not found above).
FIND_PATH
(
OPENSSL_ROOT_DIR
NAMES include/openssl/ssl.h
)
FIND_PATH
(
OPENSSL_INCLUDE_DIR
NAMES openssl/ssl.h
HINTS
${
OPENSSL_ROOT_DIR
}
/include
)
IF
(
WIN32
)
FIND_FILE
(
OPENSSL_APPLINK_C
NAMES openssl/applink.c
HINTS
${
OPENSSL_ROOT_DIR
}
/include
)
MESSAGE_ONCE
(
OPENSSL_APPLINK_C
"OPENSSL_APPLINK_C
${
OPENSSL_APPLINK_C
}
"
)
ENDIF
()
# On mac this list is <.dylib;.so;.a>
# We prefer static libraries, so we revert it here.
IF
(
WITH_SSL_PATH
)
LIST
(
REVERSE CMAKE_FIND_LIBRARY_SUFFIXES
)
ENDIF
()
FIND_LIBRARY
(
OPENSSL_SSL_LIBRARY
NAMES ssl ssleay32 ssleay32MD
HINTS
${
OPENSSL_ROOT_DIR
}
/lib
)
FIND_LIBRARY
(
OPENSSL_CRYPTO_LIBRARY
NAMES crypto libeay32
HINTS
${
OPENSSL_ROOT_DIR
}
/lib
)
MARK_AS_ADVANCED
(
OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY OPENSSL_ROOT_DIR
OPENSSL_INCLUDE_DIR
)
IF
(
WITH_SSL_PATH
)
LIST
(
REVERSE CMAKE_FIND_LIBRARY_SUFFIXES
)
IF
(
NOT OPENSSL_ROOT_DIR
)
IF
(
WITH_SSL_PATH
)
SET
(
OPENSSL_ROOT_DIR
${
WITH_SSL_PATH
}
)
ENDIF
()
ENDIF
()
I
NCLUDE
(
CheckSymbolExists
)
SET
(
CMAKE_REQUIRED_INCLUDES
${
OPENSSL_INCLUDE_DIR
}
)
CHECK_SYMBOL_EXISTS
(
SHA512_DIGEST_LENGTH
"openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH
)
SET
(
CMAKE_REQUIRED_INCLUDES
)
IF
(
OPENSSL_INCLUDE_DIR AND OPENSSL_SSL_LIBRARY AND
OPENSSL_CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH
)
FIND_PACKAGE
(
OpenSSL
)
I
F
(
OPENSSL_FOUND
)
SET
(
OPENSSL_LIBRARY
${
OPENSSL_SSL_LIBRARY
}
)
INCLUDE
(
CheckSymbolExists
)
SET
(
CMAKE_REQUIRED_INCLUDES
${
OPENSSL_INCLUDE_DIR
}
)
CHECK_SYMBOL_EXISTS
(
SHA512_DIGEST_LENGTH
"openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH
)
SET
(
CMAKE_REQUIRED_INCLUDES
)
SET
(
SSL_SOURCES
""
)
SET
(
SSL_LIBRARIES
${
OPENSSL_SSL_LIBRARY
}
${
OPENSSL_CRYPTO_LIBRARY
}
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"SunOS"
)
...
...
@@ -177,16 +141,6 @@ MACRO (MYSQL_CHECK_SSL)
SET
(
SSL_LIBRARIES
${
SSL_LIBRARIES
}
${
LIBDL
}
)
ENDIF
()
# Verify version number. Version information looks like:
# #define OPENSSL_VERSION_NUMBER 0x1000103fL
# Encoded as MNNFFPPS: major minor fix patch status
FILE
(
STRINGS
"
${
OPENSSL_INCLUDE_DIR
}
/openssl/opensslv.h"
OPENSSL_VERSION_TEXT
REGEX
"^# *define[
\t
]+OPENSSL_VERSION_TEXT[
\t
]+"
)
STRING
(
REGEX REPLACE
"^.*OPENSSL_VERSION_TEXT[
\t
]+
\"
OpenSSL ([-0-9a-z.]+).*$"
"
\\
1"
OPENSSL_VERSION
"
${
OPENSSL_VERSION_TEXT
}
"
)
MESSAGE_ONCE
(
OPENSSL_INCLUDE_DIR
"OPENSSL_INCLUDE_DIR =
${
OPENSSL_INCLUDE_DIR
}
"
)
MESSAGE_ONCE
(
OPENSSL_SSL_LIBRARY
"OPENSSL_SSL_LIBRARY =
${
OPENSSL_SSL_LIBRARY
}
"
)
MESSAGE_ONCE
(
OPENSSL_CRYPTO_LIBRARY
"OPENSSL_CRYPTO_LIBRARY =
${
OPENSSL_CRYPTO_LIBRARY
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment