Skip to content

Search the Conan config files before the system in the install test - #548

Merged
lo-simon merged 2 commits into
sony:masterfrom
garethsb:bugfix/install-test-prefix-path
Nov 18, 2026
Merged

lo-simon merged 2 commits into
sony:masterfrom
garethsb:bugfix/install-test-prefix-path

Conversation

@garethsb

Copy link
Copy Markdown
Contributor

Prepares for an ubuntu-26.04 runner, without adding one.

The install test configures Sandbox/my-nmos-node against the installed nmos-cpp. It 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 on ubuntu-26.04 CMake finds that instead of Conan's, and the configure fails because the openssl::openssl target that cpprestsdk, websocketpp and jwt-cpp link is not defined.

This PR:

  • adds the Conan directory to CMAKE_PREFIX_PATH, which CMake searches before the system directories, instead of setting CMAKE_INSTALL_PREFIX
  • stops setting CMAKE_MODULE_PATH, because with CMAKE_FIND_PACKAGE_PREFER_CONFIG CMake uses Conan's config files rather than find modules
  • documents in Getting-Started that a project using an nmos-cpp built using Conan needs both CMAKE_PREFIX_PATH and CMAKE_FIND_PACKAGE_PREFER_CONFIG

The install test now configures Sandbox/my-nmos-node with only the settings that Getting-Started gives.

Throwaway runs on my fork tested this on ubuntu-26.04 and ubuntu-24.04:

The Windows install test without CMAKE_MODULE_PATH is tested only by this PR's CI.

Co-authored-by: Gareth's 🤖 buddy

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>

@lo-simon lo-simon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@lo-simon
lo-simon merged commit b80972b into sony:master Nov 18, 2026
12 checks passed
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