Repository navigation
Search the Conan config files before the system in the install test - #548
Merged
Merged
Conversation
The install test found the config files that Conan generated for nmos-cpp's dependencies only through CMAKE_INSTALL_PREFIX, which CMake searches after the system directories. Ubuntu 26.04's libssl-dev ships OpenSSLConfig.cmake, so CMake would find that instead of Conan's, and the openssl::openssl target that cpprestsdk, websocketpp and jwt-cpp link would be missing. Add the Conan directory to CMAKE_PREFIX_PATH instead, which CMake searches first. Also stop setting CMAKE_MODULE_PATH. With CMAKE_FIND_PACKAGE_PREFER_CONFIG, find_package uses the config files that Conan's CMakeDeps generator writes, and not find modules, so the install test configures Sandbox/my-nmos-node with only the settings that Getting-Started gives. Signed-off-by: Gareth Sylvester-Bradley <garethsb@nvidia.com>
A project that uses an nmos-cpp built using Conan has to find the config files that Conan generated for nmos-cpp's dependencies. With only CMAKE_PREFIX_PATH, CMake's own find modules find system packages and the configure fails; CMAKE_FIND_PACKAGE_PREFER_CONFIG is also needed. The install test configures Sandbox/my-nmos-node with these settings. Signed-off-by: Gareth Sylvester-Bradley <garethsb@nvidia.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares for an ubuntu-26.04 runner, without adding one.
The install test configures
Sandbox/my-nmos-nodeagainst the installed nmos-cpp. It found the config files that Conan generated for nmos-cpp's dependencies only throughCMAKE_INSTALL_PREFIX, which CMake searches after the system directories. Ubuntu 26.04'slibssl-devshipsOpenSSLConfig.cmake, so on ubuntu-26.04 CMake finds that instead of Conan's, and the configure fails because theopenssl::openssltarget that cpprestsdk, websocketpp and jwt-cpp link is not defined.This PR:
CMAKE_PREFIX_PATH, which CMake searches before the system directories, instead of settingCMAKE_INSTALL_PREFIXCMAKE_MODULE_PATH, because withCMAKE_FIND_PACKAGE_PREFER_CONFIGCMake uses Conan's config files rather than find modulesCMAKE_PREFIX_PATHandCMAKE_FIND_PACKAGE_PREFER_CONFIGThe install test now configures
Sandbox/my-nmos-nodewith only the settings that Getting-Started gives.Throwaway runs on my fork tested this on ubuntu-26.04 and ubuntu-24.04:
CMAKE_PREFIX_PATHchange, the ubuntu-26.04 Conan jobs passed the install test and all the AMWA test suites (https://github.com/garethsb/nmos-cpp/actions/runs/44316898534)Sandbox/my-nmos-nodewithCMAKE_PREFIX_PATHandCMAKE_FIND_PACKAGE_PREFER_CONFIGsucceeded on both, and withCMAKE_PREFIX_PATHalone failed on both (https://github.com/garethsb/nmos-cpp/actions/runs/44321199861)The Windows install test without
CMAKE_MODULE_PATHis tested only by this PR's CI.Co-authored-by: Gareth's 🤖 buddy