I am trying to get started with _Simple-Web-Server_ over at
https://gitlab.com/eidheim/Simple-Web-Server
vcpkg install openssl:x64-windows
installed_two openssl libraries:
_openssl[core]:x64-windows_
_* openssl-windows[core]:x64-windows_
vcpkg list
lists these
_openssl-windows:x64-windows_
_openssl:x64-windows_
_openssl:x64-windows_ had version number 0 and contained no actual files
Run (windows-button + r) _openssl_
OpenSSL> version
OpenSSL 1.0.2p 14 Aug 2018
enter _Simple-Web-Server\build_ dir and run this command
cmake .. "-DCMAKE_TOOLCHAIN_FILE=D:\vcpkg\scripts\buildsystems\vcpkg.cmake"
produces this error
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: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.12/Modules/FindOpenSSL.cmake:412 (find_package_handle_standard_args)
D:/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package)
Simple-WebSocket-Server/CMakeLists.txt:48 (find_package)
from CMakeCache.txt
//The CMake toolchain file
CMAKE_TOOLCHAIN_FILE:FILEPATH=D:/vcpkg/scripts/buildsystems/vcpkg.cmake
I have tried different openssl version, and even deleting the empty _openssl:x64-windows_
I am using windows 10, with the command prompt for VS 2017
I am not sure if this is a vcpkg, cmake or openssl issue
vcpkg integrate install ?
or
cmake .. -DCMAKE_PREFIX_PATH="D:/vcpkg/installed/x64-windows-static" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="D:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_STATIC=ON -DCMAKE_CL_64=1 -G"Visual Studio 15 2017 Win64"
-DCMAKE_PREFIX_PATH
I forgot to write it,
I did
vcpkg integrate install
it said it was successful
set OPENSSL_ROOT_DIR="D:/vcpkg/installed/x64-windows-static"
cmake .. -DOPENSSL_ROOT_DIR="D:/vcpkg/installed/x64-windows-static" ...
ok thanks, I will try the new cmake commands
I am not currently close to a machine that I can try this on. I will try tomorrow
wow thanks a lot!
adding -DOPENSSL_ROOT_DIR="D:/vcpkg/installed/x64-windows-static"
worked like a charm!
Had the same problem, -DVCPKG_TARGET_TRIPLET=x64-windows-static did the trick.
Thanks guys. I got a similar issue though my environment is slightly different as my MSVC, vcpkg, OpenSSL are all the latest versions. I fixed it by adding -DOPENSSL_ROOT_DIR="C:/vcpkg/installed/x64-windows-static":
https://kontext.tech/column/c_and_cplusplus/443/cmake-build-error-could-not-find-openssl-on-windows-10
Most helpful comment
set OPENSSL_ROOT_DIR="D:/vcpkg/installed/x64-windows-static"cmake .. -DOPENSSL_ROOT_DIR="D:/vcpkg/installed/x64-windows-static" ...