PostgreSQL native library for Tarantool programming language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindOpenSSL.cmake 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindOpenSSL
  5. -----------
  6. Find the OpenSSL encryption library.
  7. Optional COMPONENTS
  8. ^^^^^^^^^^^^^^^^^^^
  9. This module supports two optional COMPONENTS: ``Crypto`` and ``SSL``. Both
  10. components have associated imported targets, as described below.
  11. Imported Targets
  12. ^^^^^^^^^^^^^^^^
  13. This module defines the following :prop_tgt:`IMPORTED` targets:
  14. ``OpenSSL::SSL``
  15. The OpenSSL ``ssl`` library, if found.
  16. ``OpenSSL::Crypto``
  17. The OpenSSL ``crypto`` library, if found.
  18. Result Variables
  19. ^^^^^^^^^^^^^^^^
  20. This module will set the following variables in your project:
  21. ``OPENSSL_FOUND``
  22. System has the OpenSSL library. If no components are requested it only
  23. requires the crypto library.
  24. ``OPENSSL_INCLUDE_DIR``
  25. The OpenSSL include directory.
  26. ``OPENSSL_CRYPTO_LIBRARY``
  27. The OpenSSL crypto library.
  28. ``OPENSSL_SSL_LIBRARY``
  29. The OpenSSL SSL library.
  30. ``OPENSSL_LIBRARIES``
  31. All OpenSSL libraries.
  32. ``OPENSSL_VERSION``
  33. This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
  34. Hints
  35. ^^^^^
  36. Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
  37. Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
  38. Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib.
  39. #]=======================================================================]
  40. if (UNIX)
  41. find_package(PkgConfig QUIET)
  42. pkg_check_modules(_OPENSSL QUIET openssl)
  43. endif ()
  44. # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  45. if(OPENSSL_USE_STATIC_LIBS)
  46. set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  47. if(WIN32)
  48. set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  49. else()
  50. set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
  51. endif()
  52. endif()
  53. if (WIN32)
  54. # http://www.slproweb.com/products/Win32OpenSSL.html
  55. set(_OPENSSL_ROOT_HINTS
  56. ${OPENSSL_ROOT_DIR}
  57. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
  58. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
  59. ENV OPENSSL_ROOT_DIR
  60. )
  61. file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
  62. set(_OPENSSL_ROOT_PATHS
  63. "${_programfiles}/OpenSSL"
  64. "${_programfiles}/OpenSSL-Win32"
  65. "${_programfiles}/OpenSSL-Win64"
  66. "C:/OpenSSL/"
  67. "C:/OpenSSL-Win32/"
  68. "C:/OpenSSL-Win64/"
  69. )
  70. unset(_programfiles)
  71. else ()
  72. set(_OPENSSL_ROOT_HINTS
  73. ${OPENSSL_ROOT_DIR}
  74. ENV OPENSSL_ROOT_DIR
  75. )
  76. endif ()
  77. set(_OPENSSL_ROOT_HINTS_AND_PATHS
  78. HINTS ${_OPENSSL_ROOT_HINTS}
  79. PATHS ${_OPENSSL_ROOT_PATHS}
  80. )
  81. find_path(OPENSSL_INCLUDE_DIR
  82. NAMES
  83. openssl/ssl.h
  84. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  85. HINTS
  86. ${_OPENSSL_INCLUDEDIR}
  87. PATH_SUFFIXES
  88. include
  89. )
  90. if(WIN32 AND NOT CYGWIN)
  91. if(MSVC)
  92. # /MD and /MDd are the standard values - if someone wants to use
  93. # others, the libnames have to change here too
  94. # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
  95. # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL)
  96. # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
  97. # * MD for dynamic-release
  98. # * MDd for dynamic-debug
  99. # * MT for static-release
  100. # * MTd for static-debug
  101. # Implementation details:
  102. # We are using the libraries located in the VC subdir instead of the parent directory even though :
  103. # libeay32MD.lib is identical to ../libeay32.lib, and
  104. # ssleay32MD.lib is identical to ../ssleay32.lib
  105. # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static
  106. if (OPENSSL_MSVC_STATIC_RT)
  107. set(_OPENSSL_MSVC_RT_MODE "MT")
  108. else ()
  109. set(_OPENSSL_MSVC_RT_MODE "MD")
  110. endif ()
  111. # Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
  112. if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
  113. set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
  114. else()
  115. set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
  116. endif()
  117. if(OPENSSL_USE_STATIC_LIBS)
  118. set(_OPENSSL_PATH_SUFFIXES
  119. "lib/VC/static"
  120. "VC/static"
  121. "lib"
  122. )
  123. else()
  124. set(_OPENSSL_PATH_SUFFIXES
  125. "lib/VC"
  126. "VC"
  127. "lib"
  128. )
  129. endif ()
  130. find_library(LIB_EAY_DEBUG
  131. NAMES
  132. libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
  133. libcrypto${_OPENSSL_MSVC_RT_MODE}d
  134. libcryptod
  135. libeay32${_OPENSSL_MSVC_RT_MODE}d
  136. libeay32d
  137. cryptod
  138. NAMES_PER_DIR
  139. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  140. PATH_SUFFIXES
  141. ${_OPENSSL_PATH_SUFFIXES}
  142. )
  143. find_library(LIB_EAY_RELEASE
  144. NAMES
  145. libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
  146. libcrypto${_OPENSSL_MSVC_RT_MODE}
  147. libcrypto
  148. libeay32${_OPENSSL_MSVC_RT_MODE}
  149. libeay32
  150. crypto
  151. NAMES_PER_DIR
  152. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  153. PATH_SUFFIXES
  154. ${_OPENSSL_PATH_SUFFIXES}
  155. )
  156. find_library(SSL_EAY_DEBUG
  157. NAMES
  158. libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
  159. libssl${_OPENSSL_MSVC_RT_MODE}d
  160. libssld
  161. ssleay32${_OPENSSL_MSVC_RT_MODE}d
  162. ssleay32d
  163. ssld
  164. NAMES_PER_DIR
  165. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  166. PATH_SUFFIXES
  167. ${_OPENSSL_PATH_SUFFIXES}
  168. )
  169. find_library(SSL_EAY_RELEASE
  170. NAMES
  171. libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
  172. libssl${_OPENSSL_MSVC_RT_MODE}
  173. libssl
  174. ssleay32${_OPENSSL_MSVC_RT_MODE}
  175. ssleay32
  176. ssl
  177. NAMES_PER_DIR
  178. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  179. PATH_SUFFIXES
  180. ${_OPENSSL_PATH_SUFFIXES}
  181. )
  182. set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
  183. set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
  184. set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
  185. set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
  186. include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
  187. select_library_configurations(LIB_EAY)
  188. select_library_configurations(SSL_EAY)
  189. mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
  190. SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
  191. set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} )
  192. set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} )
  193. elseif(MINGW)
  194. # same player, for MinGW
  195. set(LIB_EAY_NAMES crypto libeay32)
  196. set(SSL_EAY_NAMES ssl ssleay32)
  197. find_library(LIB_EAY
  198. NAMES
  199. ${LIB_EAY_NAMES}
  200. NAMES_PER_DIR
  201. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  202. PATH_SUFFIXES
  203. "lib/MinGW"
  204. "lib"
  205. )
  206. find_library(SSL_EAY
  207. NAMES
  208. ${SSL_EAY_NAMES}
  209. NAMES_PER_DIR
  210. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  211. PATH_SUFFIXES
  212. "lib/MinGW"
  213. "lib"
  214. )
  215. mark_as_advanced(SSL_EAY LIB_EAY)
  216. set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
  217. set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
  218. unset(LIB_EAY_NAMES)
  219. unset(SSL_EAY_NAMES)
  220. else()
  221. # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
  222. find_library(LIB_EAY
  223. NAMES
  224. libcrypto
  225. libeay32
  226. NAMES_PER_DIR
  227. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  228. HINTS
  229. ${_OPENSSL_LIBDIR}
  230. PATH_SUFFIXES
  231. lib
  232. )
  233. find_library(SSL_EAY
  234. NAMES
  235. libssl
  236. ssleay32
  237. NAMES_PER_DIR
  238. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  239. HINTS
  240. ${_OPENSSL_LIBDIR}
  241. PATH_SUFFIXES
  242. lib
  243. )
  244. mark_as_advanced(SSL_EAY LIB_EAY)
  245. set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
  246. set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
  247. endif()
  248. else()
  249. find_library(OPENSSL_SSL_LIBRARY
  250. NAMES
  251. ssl
  252. ssleay32
  253. ssleay32MD
  254. NAMES_PER_DIR
  255. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  256. HINTS
  257. ${_OPENSSL_LIBDIR}
  258. PATH_SUFFIXES
  259. lib
  260. )
  261. find_library(OPENSSL_CRYPTO_LIBRARY
  262. NAMES
  263. crypto
  264. NAMES_PER_DIR
  265. ${_OPENSSL_ROOT_HINTS_AND_PATHS}
  266. HINTS
  267. ${_OPENSSL_LIBDIR}
  268. PATH_SUFFIXES
  269. lib
  270. )
  271. mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
  272. # compat defines
  273. set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
  274. set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
  275. endif()
  276. function(from_hex HEX DEC)
  277. string(TOUPPER "${HEX}" HEX)
  278. set(_res 0)
  279. string(LENGTH "${HEX}" _strlen)
  280. while (_strlen GREATER 0)
  281. math(EXPR _res "${_res} * 16")
  282. string(SUBSTRING "${HEX}" 0 1 NIBBLE)
  283. string(SUBSTRING "${HEX}" 1 -1 HEX)
  284. if (NIBBLE STREQUAL "A")
  285. math(EXPR _res "${_res} + 10")
  286. elseif (NIBBLE STREQUAL "B")
  287. math(EXPR _res "${_res} + 11")
  288. elseif (NIBBLE STREQUAL "C")
  289. math(EXPR _res "${_res} + 12")
  290. elseif (NIBBLE STREQUAL "D")
  291. math(EXPR _res "${_res} + 13")
  292. elseif (NIBBLE STREQUAL "E")
  293. math(EXPR _res "${_res} + 14")
  294. elseif (NIBBLE STREQUAL "F")
  295. math(EXPR _res "${_res} + 15")
  296. else()
  297. math(EXPR _res "${_res} + ${NIBBLE}")
  298. endif()
  299. string(LENGTH "${HEX}" _strlen)
  300. endwhile()
  301. set(${DEC} ${_res} PARENT_SCOPE)
  302. endfunction()
  303. if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
  304. file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
  305. REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
  306. if(openssl_version_str)
  307. # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
  308. # The status gives if this is a developer or prerelease and is ignored here.
  309. # Major, minor, and fix directly translate into the version numbers shown in
  310. # the string. The patch field translates to the single character suffix that
  311. # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
  312. # on.
  313. string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
  314. "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
  315. list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
  316. list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
  317. from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
  318. list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
  319. from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
  320. list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
  321. if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
  322. from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
  323. # 96 is the ASCII code of 'a' minus 1
  324. math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
  325. unset(_tmp)
  326. # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
  327. # this should be updated to handle that, too. This has not happened yet
  328. # so it is simply ignored here for now.
  329. string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
  330. endif ()
  331. set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
  332. endif ()
  333. endif ()
  334. set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
  335. foreach(_comp IN LISTS OpenSSL_FIND_COMPONENTS)
  336. if(_comp STREQUAL "Crypto")
  337. if(EXISTS "${OPENSSL_INCLUDE_DIR}" AND
  338. (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR
  339. EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR
  340. EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
  341. )
  342. set(OpenSSL_${_comp}_FOUND TRUE)
  343. else()
  344. set(OpenSSL_${_comp}_FOUND FALSE)
  345. endif()
  346. elseif(_comp STREQUAL "SSL")
  347. if(EXISTS "${OPENSSL_INCLUDE_DIR}" AND
  348. (EXISTS "${OPENSSL_SSL_LIBRARY}" OR
  349. EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR
  350. EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
  351. )
  352. set(OpenSSL_${_comp}_FOUND TRUE)
  353. else()
  354. set(OpenSSL_${_comp}_FOUND FALSE)
  355. endif()
  356. else()
  357. message(WARNING "${_comp} is not a valid OpenSSL component")
  358. set(OpenSSL_${_comp}_FOUND FALSE)
  359. endif()
  360. endforeach()
  361. unset(_comp)
  362. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  363. find_package_handle_standard_args(OpenSSL
  364. REQUIRED_VARS
  365. OPENSSL_CRYPTO_LIBRARY
  366. OPENSSL_INCLUDE_DIR
  367. VERSION_VAR
  368. OPENSSL_VERSION
  369. HANDLE_COMPONENTS
  370. FAIL_MESSAGE
  371. "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
  372. )
  373. mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
  374. if(OPENSSL_FOUND)
  375. if(NOT TARGET OpenSSL::Crypto AND
  376. (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR
  377. EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR
  378. EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
  379. )
  380. add_library(OpenSSL::Crypto UNKNOWN IMPORTED)
  381. set_target_properties(OpenSSL::Crypto PROPERTIES
  382. INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
  383. if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}")
  384. set_target_properties(OpenSSL::Crypto PROPERTIES
  385. IMPORTED_LINK_INTERFACE_LANGUAGES "C"
  386. IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}")
  387. endif()
  388. if(EXISTS "${LIB_EAY_LIBRARY_RELEASE}")
  389. set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
  390. IMPORTED_CONFIGURATIONS RELEASE)
  391. set_target_properties(OpenSSL::Crypto PROPERTIES
  392. IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
  393. IMPORTED_LOCATION_RELEASE "${LIB_EAY_LIBRARY_RELEASE}")
  394. endif()
  395. if(EXISTS "${LIB_EAY_LIBRARY_DEBUG}")
  396. set_property(TARGET OpenSSL::Crypto APPEND PROPERTY
  397. IMPORTED_CONFIGURATIONS DEBUG)
  398. set_target_properties(OpenSSL::Crypto PROPERTIES
  399. IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
  400. IMPORTED_LOCATION_DEBUG "${LIB_EAY_LIBRARY_DEBUG}")
  401. endif()
  402. endif()
  403. if(NOT TARGET OpenSSL::SSL AND
  404. (EXISTS "${OPENSSL_SSL_LIBRARY}" OR
  405. EXISTS "${SSL_EAY_LIBRARY_DEBUG}" OR
  406. EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
  407. )
  408. add_library(OpenSSL::SSL UNKNOWN IMPORTED)
  409. set_target_properties(OpenSSL::SSL PROPERTIES
  410. INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
  411. if(EXISTS "${OPENSSL_SSL_LIBRARY}")
  412. set_target_properties(OpenSSL::SSL PROPERTIES
  413. IMPORTED_LINK_INTERFACE_LANGUAGES "C"
  414. IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}")
  415. endif()
  416. if(EXISTS "${SSL_EAY_LIBRARY_RELEASE}")
  417. set_property(TARGET OpenSSL::SSL APPEND PROPERTY
  418. IMPORTED_CONFIGURATIONS RELEASE)
  419. set_target_properties(OpenSSL::SSL PROPERTIES
  420. IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
  421. IMPORTED_LOCATION_RELEASE "${SSL_EAY_LIBRARY_RELEASE}")
  422. endif()
  423. if(EXISTS "${SSL_EAY_LIBRARY_DEBUG}")
  424. set_property(TARGET OpenSSL::SSL APPEND PROPERTY
  425. IMPORTED_CONFIGURATIONS DEBUG)
  426. set_target_properties(OpenSSL::SSL PROPERTIES
  427. IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
  428. IMPORTED_LOCATION_DEBUG "${SSL_EAY_LIBRARY_DEBUG}")
  429. endif()
  430. if(TARGET OpenSSL::Crypto)
  431. set_target_properties(OpenSSL::SSL PROPERTIES
  432. INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
  433. endif()
  434. endif()
  435. endif()
  436. # Restore the original find library ordering
  437. if(OPENSSL_USE_STATIC_LIBS)
  438. set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  439. endif()