title: Could NOT find LibCrypto (missing: LibCrypto_LIBRARY LibCrypto_INCLUDE_DIR)
body: <p>This is a follow up to:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/67335322/building-the-aws-sdk-from-source-on-amazon-linux-2">Building the AWS SDK from source on Amazon Linux 2</a></li>
  </ul>
  <p>Based on the answer I tried again locally:</p>
  <pre><code>$ git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git
  $ cd aws-sdk-cpp
  $ mkdir build
  $ cmake .. -DBUILD_ONLY=core -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/install
  $ make install -i
  </code></pre>
  <p>I was forced to use <code>'-i'</code> because at least one test is failing (seems like <code>'make test'</code> rule is inside <code>'make all'</code>).</p>
  <p>then from my pet project:</p>
  <pre><code>% cat ../CMakeLists.txt
  cmake_minimum_required(VERSION 3.2)
  project(lambda-example)
  set (CMAKE_CXX_STANDARD 11)
  
  # Locate the aws sdk for c++ package.
  find_package(AWSSDK REQUIRED COMPONENTS lambda)
  
  # The executables to build.
  set(EXAMPLES &quot;&quot;)
  list(APPEND EXAMPLES &quot;main&quot;)
  
  # The executables to build
  foreach(EXAMPLE IN LISTS EXAMPLES)
    add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
    target_link_libraries(${EXAMPLE} ${AWSSDK_LINK_LIBRARIES})
  endforeach()
  </code></pre>
  <p>I get:</p>
  <pre><code>% cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
  -- The C compiler identification is GNU 8.3.0
  -- The CXX compiler identification is GNU 8.3.0
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found AWS SDK for C++, Version: 1.9.18, Install Root:/home/mathieu/install, Platform Prefix:, Platform Dependent Libraries: pthread;crypto;ssl;z;curl
  -- Components specified for AWSSDK: lambda, application will be depending on libs: aws-cpp-sdk-lambda;aws-cpp-sdk-core;aws-crt-cpp;aws-c-auth;aws-c-cal;aws-c-common;aws-c-compression;aws-c-event-stream;aws-c-http;aws-c-io;aws-c-mqtt;aws-c-s3;aws-checksums;pthread;crypto;ssl;z;curl
  -- Try finding aws-cpp-sdk-core
  -- Looking for pthread.h
  -- Looking for pthread.h - found
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
  -- Check if compiler accepts -pthread
  -- Check if compiler accepts -pthread - yes
  -- Found Threads: TRUE
  -- Found LibCrypto: /usr/lib/x86_64-linux-gnu/libcrypto.so
  -- LibCrypto Include Dir: /usr/include
  -- LibCrypto Shared Lib:  /usr/lib/x86_64-linux-gnu/libcrypto.so
  -- LibCrypto Static Lib:  /usr/lib/x86_64-linux-gnu/libcrypto.so
  CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
    Could NOT find LibCrypto (missing: LibCrypto_LIBRARY LibCrypto_INCLUDE_DIR)
  Call Stack (most recent call first):
    /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
    /home/mathieu/install/lib/s2n/cmake/modules/FindLibCrypto.cmake:61 (find_package_handle_standard_args)
    /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
    /home/mathieu/install/lib/aws-c-cal/cmake/aws-c-cal-config.cmake:7 (find_dependency)
    /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
    /home/mathieu/install/lib/aws-c-io/cmake/aws-c-io-config.cmake:8 (find_dependency)
    /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
    /home/mathieu/install/lib/aws-c-http/cmake/aws-c-http-config.cmake:3 (find_dependency)
    /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
    /home/mathieu/install/lib/aws-crt-cpp/cmake/aws-crt-cpp-config.cmake:3 (find_dependency)
    /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
    /home/mathieu/install/lib/cmake/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake:2 (find_dependency)
    /home/mathieu/install/lib/cmake/AWSSDK/AWSSDKConfig.cmake:305 (find_package)
    CMakeLists.txt:6 (find_package)
  
  -- Configuring incomplete, errors occurred!
  See also &quot;/home/mathieu/workspace/junk/bin/CMakeFiles/CMakeOutput.log&quot;.
  See also &quot;/home/mathieu/workspace/junk/bin/CMakeFiles/CMakeError.log&quot;.
  </code></pre>
  <p>The above is based on the reading of the following:</p>
  <ol>
  <li><a href="https://github.com/aws/aws-sdk-cpp/wiki/Building-the-SDK-from-source-on-EC2" rel="nofollow noreferrer">Building the SDK from source on EC2</a></li>
  <li><a href="https://www.proud2becloud.com/how-to-run-any-programming-language-on-aws-lambda-custom-runtimes/" rel="nofollow noreferrer">How to run any programming language on AWS Lambda: Custom Runtimes.</a></li>
  <li><a href="https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-cpp-example_code-lambda.html" rel="nofollow noreferrer">C++ Code Samples for AWS Lambda</a></li>
  </ol>
  <p>The error message seems to contradict itself:</p>
  <pre><code>-- Found LibCrypto: /usr/lib/x86_64-linux-gnu/libcrypto.so
  [...]
  CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
    Could NOT find LibCrypto (missing: LibCrypto_LIBRARY LibCrypto_INCLUDE_DIR)
  </code></pre>
  <p>What am I missing ?</p>