Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] manually set PKG_CONFIG_PATH for openssl on macOS #246

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

spoonincode
Copy link
Member

yubihsm's OpenSSL discovery is via pkg-config instead of find_package. On ARM macOS builds pkg-config is having trouble finding openssl due to nonstandard paths. Let's help it out by manually setting the PKG_CONFIG_PATH environment variable. After this change, provided prerequisite packages are installed via homebrew, one only needs to

cmake -DCMAKE_BUILD_TYPE=Release ..

and macOS builds are operational on both Intel & ARM platforms.

This change is a little icky, but I'm trying not to overthink it as YubiHSM will be removed post 3.2.

# files may not be found down in the /opt/homebrew/opt directory
if(APPLE)
get_filename_component(OPENSSL_LIB_PATH "${OPENSSL_CRYPTO_LIBRARY}" DIRECTORY)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${OPENSSL_LIB_PATH}/pkgconfig")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw no problems here empirically with PKG_CONFIG_PATH being empty resulting in a :<path>

@spoonincode spoonincode merged commit fad7891 into main Sep 28, 2022
@spoonincode spoonincode deleted the pkgconfig_crypto_mac branch September 28, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants