From 5764f52c703019735d338d52d99252ab77e02f9f Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Mon, 13 Jan 2025 23:38:09 -0500 Subject: [PATCH] CMake: fix issue finding openssl include directory for Rust build --- libclamav_rust/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libclamav_rust/CMakeLists.txt b/libclamav_rust/CMakeLists.txt index bae604db0c..210b0fd082 100644 --- a/libclamav_rust/CMakeLists.txt +++ b/libclamav_rust/CMakeLists.txt @@ -4,9 +4,10 @@ # Copyright (C) 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved. # -# if OPENSSL_ROOT_DIR is set, pass it to the environment -if(OPENSSL_ROOT_DIR) - set(ENVIRONMENT "OPENSSL_DIR=${OPENSSL_ROOT_DIR}") +# if OPENSSL_INCLUDE_DIR is set, use it to determine the OPENSSL_DIR +if(OPENSSL_INCLUDE_DIR) + get_filename_component(OPENSSL_DIR ${OPENSSL_INCLUDE_DIR} DIRECTORY) + set(ENVIRONMENT "OPENSSL_DIR=${OPENSSL_DIR}") else () set(ENVIRONMENT "") endif()