There are two versions of openssl in my virtual machine, one is in /usr/include and /usr/lib, and the other is the version I modified myself, which is installed in /opt/openssl and modified by myself.I want to link to my customized openssl project located in /opt/openssl via cmake.
The code is run on Ubuntu 22.04.
The modified version has neither OpenSSLConfig.cmake nor openssl-config.cmake, which causes an error when I executed find_package (OpenSSL REQUIRED PATHS /opt/openssl).
I also tried set(OPENSSL_INCLUDE_DIR "/opt/openssl/include")
set(OPENSSL_LIBRARY_DIR "/opt/openssl/lib64")
and at the end
target_link_libraries(tutorial-01-wget PRIVATE /opt/openssl/lib64/libssl.so /opt/openssl/lib64/libcrypto.so ${WORKFLOW_LIB})
But the final detected version and the packet capture analysis all show that the link should be the version in my /usr/include, which makes me very confused how to solve it.
 
    