From f104bdb3b98fb23949e65a15e0c7cf45aff8cdba Mon Sep 17 00:00:00 2001 From: "Meszaros, Gergely" Date: Tue, 26 Aug 2025 07:58:03 +0000 Subject: [PATCH] Help: Specify `_DIR` interaction with a version Explicitly state that if `_DIR` is set, but the version of the package found there does not match the requested version, then `find_package` will ignore that directory and continue searching. --- Help/command/find_package.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index a3ceef2673..97390f76f3 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -338,7 +338,9 @@ an error describing the problem unless the ``QUIET`` argument is specified. If ``REQUIRED`` is specified and the package is not found, a fatal error is generated and the configure step stops executing. If ``_DIR`` has been set to a directory not containing a -configuration file, CMake will ignore it and search from scratch. +configuration file, or if the requested version is not compatible +with the package found in that directory (see :ref:`version selection`), +CMake will ignore it and search from scratch. Package maintainers providing package configuration files are encouraged to name and install them such that the :ref:`search procedure` outlined below