<commit_before># Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#.rst:
# FindOpenSSL
# -----------
#
# Find the OpenSSL encryption library.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` targets:
#
# ``OpenSSL::SSL``
#   The OpenSSL ``ssl`` library, if found.
# ``OpenSSL::Crypto``
#   The OpenSSL ``crypto`` library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``OPENSSL_FOUND``
#   System has the OpenSSL library.
# ``OPENSSL_INCLUDE_DIR``
#   The OpenSSL include directory.
# ``OPENSSL_CRYPTO_LIBRARY``
#   The OpenSSL crypto library.
# ``OPENSSL_SSL_LIBRARY``
#   The OpenSSL SSL library.
# ``OPENSSL_LIBRARIES``
#   All OpenSSL libraries.
# ``OPENSSL_VERSION``
#   This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
#

if (UNIX)
	message(FATAL_ERROR "FindOpenssl not implemented on UNIX")
endif ()

## get path parts determined by configuration
if(OPENSSL_USE_STATIC_LIBS)
	set(BUILD_TYPE "static")
else()
	set(BUILD_TYPE "shared")
endif(OPENSSL_USE_STATIC_LIBS)

# visual studio version
if (${CMAKE_GENERATOR} MATCHES "2017")
    set(VS_VERSION "2017")
elseif (${CMAKE_GENERATOR} MATCHES "2019")
    set(VS_VERSION "2019")
else()
    message(FATAL_ERROR "Generator not supported: ${CMAKE_GENERATOR}")
endif()

#store original suffixes
set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

## find includes
set(ssl_base_path "${OPENSSL_ROOT_DIR}")
set(BUILD_MODE "release")
set(path_part "VS_${VS_VERSION}/${BUILD_TYPE}-${BUILD_MODE}")
set(ssl_search_path "${ssl_base_path}/${path_part}/")
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES} )

find_path(OPENSSL_INCLUDE_DIR
  NAMES "openssl/ssl.h"
  PATHS ${ssl_search_path}
  PATH_SUFFIXES "include"
  NO_DEFAULT_PATH
)


## find libs
set(_OPENSSL_PATH_SUFFIXES "bin" "lib")


# release<commit_msg>Check MSVC_VERSION instead of CMAKE_GENERATOR (#11351)<commit_after># Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#.rst:
# FindOpenSSL
# -----------
#
# Find the OpenSSL encryption library.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` targets:
#
# ``OpenSSL::SSL``
#   The OpenSSL ``ssl`` library, if found.
# ``OpenSSL::Crypto``
#   The OpenSSL ``crypto`` library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``OPENSSL_FOUND``
#   System has the OpenSSL library.
# ``OPENSSL_INCLUDE_DIR``
#   The OpenSSL include directory.
# ``OPENSSL_CRYPTO_LIBRARY``
#   The OpenSSL crypto library.
# ``OPENSSL_SSL_LIBRARY``
#   The OpenSSL SSL library.
# ``OPENSSL_LIBRARIES``
#   All OpenSSL libraries.
# ``OPENSSL_VERSION``
#   This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
#

if (UNIX)
	message(FATAL_ERROR "FindOpenssl not implemented on UNIX")
endif ()

## get path parts determined by configuration
if(OPENSSL_USE_STATIC_LIBS)
	set(BUILD_TYPE "static")
else()
	set(BUILD_TYPE "shared")
endif(OPENSSL_USE_STATIC_LIBS)

# visual studio version
# see https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
# related: https://cmake.org/cmake/help/latest/variable/MSVC_TOOLSET_VERSION.html
if (1909 LESS ${MSVC_VERSION} AND ${MSVC_VERSION} LESS 1920)
# 1910-1919: VS 15.0 (v141 toolset)
    set(VS_VERSION "2017")
elseif (1919 LESS ${MSVC_VERSION} AND ${MSVC_VERSION} LESS 1930)
# 1920-1929: VS 16.0 (v142 toolset)
    set(VS_VERSION "2019")
else()
    message(FATAL_ERROR "MSVC version not supported: ${MSVC_VERSION} (supported are 1910-1929)")
endif()

#store original suffixes
set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

## find includes
set(ssl_base_path "${OPENSSL_ROOT_DIR}")
set(BUILD_MODE "release")
set(path_part "VS_${VS_VERSION}/${BUILD_TYPE}-${BUILD_MODE}")
set(ssl_search_path "${ssl_base_path}/${path_part}/")
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES} )

find_path(OPENSSL_INCLUDE_DIR
  NAMES "openssl/ssl.h"
  PATHS ${ssl_search_path}
  PATH_SUFFIXES "include"
  NO_DEFAULT_PATH
)


## find libs
set(_OPENSSL_PATH_SUFFIXES "bin" "lib")


# release
{'fraction_non_alphanumeric': 0.14872842870118075, 'fraction_numerical': 0.020208900999091735, 'mean_word_length': 5.584454409566518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3622021', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1595, 'n_words': 364}