I had the same problem (openssl) and this worked for me on Ubuntu 14.04.1 LTS. The solution is the same up to Ubuntu 18.04 (tested).

sudo apt-get install libssl-dev
Answer from Arwen on Stack Overflow
🌐
Kontext
kontext.tech › home › blogs › c和c++ › cmake build error - could not find openssl on windows 10
CMake Build Error - Could not Find OpenSSL on Windows 10 - Kontext Labs
July 31, 2020 - cmake . -DOPENSSL_ROOT_DIR="C:/vcpkg/installed/x64-windows-static" The above command line tells CMake that OpenSSL root folder is in the above directory.
Discussions

CMake cant find OpenSSL
I'm not too familiar with Windows and the inbuilt FindOpenSSL, but the first thing you could try is setting https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html and pasting the logs here More on reddit.com
🌐 r/cmake
1
1
August 21, 2024
c++ - CMake cannot find OpenSSL libraries in windows - Stack Overflow
In any case, you could pass cmake a -G option with corresponding generator. ... Save this answer. Show activity on this post. It turns out if I build and install openssl manually it works. For whatever reason the raw lib i provided was not good enough for cmake to find it. More on stackoverflow.com
🌐 stackoverflow.com
CMake: Could NOT find OpenSSL
You switched accounts on another tab or window. Reload to refresh your session. ... I am trying to get started with Simple-Web-Server over at https://gitlab.com/eidheim/Simple-Web-Server ... CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL... More on github.com
🌐 github.com
7
September 3, 2018
Windows build can't find OpenSSL
Be aware -- curl version=[7.56.0-DEV] ... Error at C:/BuildPath/ThirdParty/cmake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: ... More on github.com
🌐 github.com
4
January 18, 2018
🌐
Reddit
reddit.com › r/cmake › cmake cant find openssl
r/cmake on Reddit: CMake cant find OpenSSL
August 21, 2024 -
cmake_minimum_required(VERSION 3.28)
project(FindOpenSSL)
set(CMAKE_CXX_STANDARD 23)
add_executable(FindOpenSSL main.cpp)
set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL-Win64")
find_package(OpenSSL REQUIRED)cmake_minimum_required(VERSION 3.28)
project(FindOpenSSL)
set(CMAKE_CXX_STANDARD 23)
add_executable(FindOpenSSL main.cpp)
set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL-Win64")
find_package(OpenSSL REQUIRED)

I have it as can bee seen here

And it works

I'm not feeling well, I feel extremely tired, please help. I'm using Clion

🌐
CMake
cmake.org › cmake › help › v3.6 › module › FindOpenSSL.html
FindOpenSSL — CMake 3.6.3 Documentation
Set OPENSSL_ROOT_DIR to the root directory of an OpenSSL installation. Set OPENSSL_USE_STATIC_LIBS to TRUE to look for static libraries.
🌐
GitHub
github.com › Microsoft › vcpkg › issues › 4219
CMake: Could NOT find OpenSSL · Issue #4219 · microsoft/vcpkg
September 3, 2018 - CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: ...
Author   microsoft
🌐
TechOverflow
techoverflow.net › 2021 › 09 › 02 › how-to-fix-conan-cmake-could-not-find-openssl
How to fix Conan CMake "Could NOT find OpenSSL" | TechOverflow
September 2, 2021 - CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY ...
Find elsewhere
🌐
Claudia Kuenzler
claudiokuenzler.com › blog › 1216 › could-not-find-openssl-error-compiling-cmake-source
Could NOT find OpenSSL error while compiling cmake from source
June 10, 2022 - Looking for gethostname - found -- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) CMake Error at Utilities/cmcurl/CMakeLists.txt:586 ...
🌐
GitHub
github.com › libcpr › cpr › issues › 247
Windows build can't find OpenSSL · Issue #247 · libcpr/cpr
January 18, 2018 - Be aware -- curl version=[7.56.0-DEV] ...dardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: ......
Author   libcpr
🌐
GitHub
github.com › raspberrypi › rpi-imager › issues › 351
Can't get OpenSSL detected on windows build · Issue #351 · raspberrypi/rpi-imager
February 6, 2022 - Steps to reproduce: Install QT with minw81_32 Install git bash and checkout this repo install Msys2 (64bit default) install cmake for windows from cmake.org Open Msys2 MingMW and run the following to get the 32bit dlls: pacman -S mingw-w...
Author   raspberrypi
🌐
Stack Overflow
stackoverflow.com › questions › 70344700 › cmake-could-not-find-openssl-try-to-set-the-path-to-openssl-root-on-windows-1
c++ - CMAKE : Could NOT find OpenSSL, try to set the path to OpenSSL root on windows 10 - Stack Overflow
December 14, 2021 - CMake Error at C:/Users/techn/... Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) Call Stack (most ......
🌐
CMake Discourse
discourse.cmake.org › development
How does find-openssl work? - Development - CMake Discourse
December 6, 2024 - The test is bringing in OQS library ...dardArgs.cmake:233 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR: (Required is at least......
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[SOLVED] CMake can't find OpenSSL / Newbie Corner / Arch Linux Forums
CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:2 30 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "1.1.1l") Call Stack (most recent call ...
🌐
CMake
cmake.org › cmake › help › latest › module › FindOpenSSL.html
FindOpenSSL — CMake 4.3.3 Documentation
Ensures that the OpenSSL ssl library is found. Components can be optionally specified using a standard syntax: find_package(OpenSSL [COMPONENTS <components>...])
🌐
Reddit
reddit.com › r/cmake › [question] what am i doing wrong?
r/cmake on Reddit: [Question] What am I doing wrong?
December 8, 2019 -

(I'm new to build systems and adding libraries, if I have provided insufficient information let me know in the comments.)
I've installed openssl lib using brew to /usr/local/Cellar/openssl (macOS) and when I compile my project I get an error:

CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)

CMakeLists.txt:

cmake_minimum_required(VERSION 3.15) project(recost)

set(CMAKE_CXX_STANDARD 20)

add tgbot-cpp

add_subdirectory(lib/tgbot-cpp)

add boost

set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/local/Cellar/boost/1.70.0/include") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/usr/local/Cellar/boost/1.70.0/lib")

add openssl

set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/local/Cellar/openssl/1.0.2s/include") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/usr/local/Cellar/openssl/1.0.2s/lib")

set(OPENSSL_ROOT_DIR "/usr/local/Cellar/openssl/1.0.2s/") set(OPENSSL_INCLUDE_DIR "/usr/local/Cellar/openssl/1.0.2s/include")

set(Boost_USE_MULTITHREADED ON)

find_package(Threads REQUIRED) find_package(OpenSSL REQUIRED) find_package(Boost COMPONENTS system REQUIRED) find_package(CURL) include_directories(/usr/local/include ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR})

set(BOOST_ROOT /usr/local/Cellar/boost/) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME ON) find_package(Boost REQUIRED COMPONENTS system)

target_include_directories(${Boost_INCLUDE_DIRS})

target_link_libraries(recost TgBot ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES})

add_executable(recost main.cpp)

🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
CMake can't find OpenSSL, but it's installed (Arch Linux) / Programming & Scripting / Arch Linux Forums
cmake lib/libgit2-1.7.0 -Blib/build ... compiling you need the devel or dev packages. I'm new to Arch so not yet 100% on the naming schemes. Look for openssl-devel or similar....
🌐
GitHub
github.com › janbar › openssl-cmake › issues › 26
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) · Issue #26 · janbar/openssl-cmake
February 20, 2022 - ... Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)#26 ... cmake_minimum_required(VERSION 3.5.1) ...
Author   janbar