Skip to content

Add OpenSSL install path to CMAKE_PREFIX_PATH - #265

Open
toivosnare wants to merge 1 commit into
eclipse-paho:developfrom
toivosnare:fix-cross-compilation
Open

Add OpenSSL install path to CMAKE_PREFIX_PATH#265
toivosnare wants to merge 1 commit into
eclipse-paho:developfrom
toivosnare:fix-cross-compilation

Conversation

@toivosnare

Copy link
Copy Markdown

Fixes #252

The OpenSSL install path has been passed to CMake via the OPENSSL_ROOT_DIR cache variable. However, in some cross compilation environments such as cross-rs the OPENSSL_ROOT_DIR path (and all other search paths of find_file, find_library etc.) get prepended with CMAKE_FIND_ROOT_PATH. Thus finding the OpenSSL artifacts fails.

The cross-rs environment does add the CMAKE_PREFIX_PATH to the CMAKE_FIND_ROOT_PATH [1] so adding the OpenSSL install path to the CMAKE_PREFIX_PATH fixes the issue.

[1] https://github.com/cross-rs/cross/blob/588b3c99db52b5a9c5906fab96cfadcf1bde7863/docker/toolchain.cmake#L43

In some cross compilation environments such as cross-rs the
`OPENSSL_ROOT_DIR` CMake define gets prepended with the
`CMAKE_FIND_ROOT_PATH` so CMake fails to find the OpenSSL artifacts.
The `CMAKE_PREFIX_PATH` on the other hand gets added directly as a root
path so artifacts under there can be found by CMake.

Signed-off-by: Toivo Snåre <topisn@gmail.com>
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.

1 participant