CMake Error at /home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/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: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/FindOpenSSL.cmake:390 (find_package_handle_standard_args)
CMakeLists.txt:320 (find_package)
CMake Error at /home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/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: OPENSSL_CRYPTO_LIBRARY) (found
version "1.1.1n")
EDIT 2:
I set the -DOPENSSL_CRYPTO_LIBRARY to /usr/local/opt/openssl/lib/ and now I am getting this error:
CMake Error at CMakeLists.txt:26 (add_library):
Target "coap-3" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:26 (add_library):
Target "coap-3" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:26 (add_library):
Target "coap-3" links to target "OpenSSL::SSL" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:26 (add_library):
Target "coap-3" links to target "OpenSSL::Crypto" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
-- Generating done
-- Build files have been written to: /home/boi/workspace/mangOH/apps/CoAP/_build_coap/wp77xx/component/e778058e3353e3ad686944df67e59779
ninja: build stopped: subcommand failed.
make: *** [Makefile:13: wp77xx] Error 1
CMake Error at /home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/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: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/boi/.leaf/mangOH-yellow-wp77xx-toolchain_0.7.0-linux64/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/FindOpenSSL.cmake:390 (find_package_handle_standard_args)
CMakeLists.txt:320 (find_package)
-- Configuring incomplete, errors occurred!
boi@debian:~/workspace/mangOH/components/libcoapComponent/libcoap/build$ cmake -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF -DENABLE_DOCS=OFF -DENABLE_EXAMPLES=OFF -DDTLS_BACKEND=openssl -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_BUILD_TYPE=Release . -S..
-- compiling with epoll support
-- compiling with DTLS support
-- DTLS_BACKEND: openssl
-- compiling with openssl support
-- ENABLE_DTLS:.....................ON
-- ENABLE_TCP:......................ON
-- ENABLE_DOCS:.....................OFF
-- ENABLE_EXAMPLES:.................OFF
-- DTLS_BACKEND:....................openssl
-- WITH_GNUTLS:.....................OFF
-- WITH_TINYDTLS:...................OFF
-- WITH_OPENSSL:....................ON
-- WITH_MBEDTLS:....................OFF
-- HAVE_LIBTINYDTLS:................
-- HAVE_LIBGNUTLS:..................
-- HAVE_OPENSSL:....................1
-- HAVE_MBEDTLS:....................
-- COAP_EPOLL_SUPPORT:..............1
-- CMAKE_C_COMPILER:................/usr/bin/cc
-- BUILD_SHARED_LIBS:...............ON
-- CMAKE_BUILD_TYPE:................Release
-- CMAKE_SYSTEM_PROCESSOR:..........x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/boi/workspace/mangOH/components/libcoapComponent/libcoap/build
boi@debian:~/workspace/mangOH/components/libcoapComponent/libcoap/build$ cmake --build .
Scanning dependencies of target coap-3
[ 4%] Building C object CMakeFiles/coap-3.dir/src/address.c.o
[ 8%] Building C object CMakeFiles/coap-3.dir/src/net.c.o
[ 12%] Building C object CMakeFiles/coap-3.dir/src/coap_debug.c.o
[ 16%] Building C object CMakeFiles/coap-3.dir/src/encode.c.o
[ 20%] Building C object CMakeFiles/coap-3.dir/src/uri.c.o
[ 24%] Building C object CMakeFiles/coap-3.dir/src/subscribe.c.o
[ 28%] Building C object CMakeFiles/coap-3.dir/src/resource.c.o
[ 32%] Building C object CMakeFiles/coap-3.dir/src/str.c.o
[ 36%] Building C object CMakeFiles/coap-3.dir/src/option.c.o
[ 40%] Building C object CMakeFiles/coap-3.dir/src/async.c.o
[ 44%] Building C object CMakeFiles/coap-3.dir/src/block.c.o
[ 48%] Building C object CMakeFiles/coap-3.dir/src/coap_asn1.c.o
[ 52%] Building C object CMakeFiles/coap-3.dir/src/coap_cache.c.o
[ 56%] Building C object CMakeFiles/coap-3.dir/src/coap_event.c.o
[ 60%] Building C object CMakeFiles/coap-3.dir/src/coap_hashkey.c.o
[ 64%] Building C object CMakeFiles/coap-3.dir/src/coap_io.c.o
[ 68%] Building C object CMakeFiles/coap-3.dir/src/coap_notls.c.o
[ 72%] Building C object CMakeFiles/coap-3.dir/src/coap_prng.c.o
[ 76%] Building C object CMakeFiles/coap-3.dir/src/coap_session.c.o
[ 80%] Building C object CMakeFiles/coap-3.dir/src/coap_tcp.c.o
[ 84%] Building C object CMakeFiles/coap-3.dir/src/coap_time.c.o
[ 88%] Building C object CMakeFiles/coap-3.dir/src/mem.c.o
[ 92%] Building C object CMakeFiles/coap-3.dir/src/pdu.c.o
[ 96%] Building C object CMakeFiles/coap-3.dir/src/coap_openssl.c.o
[100%] Linking C shared library libcoap-3.so
[100%] Built target coap-3
boi@debian:~/workspace/mangOH/components/libcoapComponent/libcoap/build$
BTW, you are using the library in /usr/local/opt/openssl, is that complied for x86 machine?
One more thing, from the following in your log, seems you are not using the toolchain:
CMAKE_C_COMPILER:…/usr/bin/cc
It seems your compiler (/usr/bin/cc for x86) is matching with /usr/local/opt/openssl, but the toolchain is not matched with /usr/local/opt/openssl…
How do you get /usr/local/opt/openssl?
Not sure if you need to download the openssl source code to recompile with the toolchain so that you will get something like /usr/local/opt/openssl for module’s toolchain…