Last active
February 11, 2021 16:14
-
-
Save mrts/3a4eb5a00ee8fcd88cb2ee7a6dc89e16 to your computer and use it in GitHub Desktop.
Print VCPKG OpenSSL path with CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Install VCPKG and the OpenSSL package | |
# 2. Run CMake: cmake -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake . | |
# 3. Run print-ssl-path target: cmake --build . --target print-ssl-path | |
project(PrintOpenSSLPath) | |
find_package(OpenSSL REQUIRED) | |
get_filename_component(SSL_PATH "${OPENSSL_CRYPTO_LIBRARY}" DIRECTORY) | |
get_filename_component(SSL_PATH "${SSL_PATH}/../bin" ABSOLUTE) | |
message(STATUS "SSL_PATH: ${SSL_PATH}") | |
add_custom_target(print-ssl-path | |
COMMAND "c:\Program Files\Git\bin\bash.exe" "-c" "echo SSL_PATH: ${SSL_PATH}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment