CMake: fix CMAKE_MODULE_PATH extension declaration - #1648
Open
Roman3349 wants to merge 1 commit into
Open
Conversation
jumoog
approved these changes
Feb 25, 2026
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Roman3349
force-pushed
the
fix/CMAKE_MODULE_PATH
branch
from
March 8, 2026 14:19
225fbd9 to
f7ee41b
Compare
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.
Currently. rewriting the global CMake variable
CMAKE_MODULE_PATHcan break the build of parent CMake project in which paho.mqtt.c is included as a subproject.Instead of
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"), it should by usedlist(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")as stated in the CMake documentation.This will eliminate the need for a patch for the conan package, see https://github.com/conan-io/conan-center-index/blob/9611e90bbad1c3cd274413c00d16aa2fd1df2833/recipes/paho-mqtt-c/all/conanfile.py#L83-L90.