Skip to content

Conversation

@vogoltsov
Copy link
Contributor

If paho.mqtt.cpp is added to a bigger project (e.g. as a git submodule) and later included via add_subdirectory, the project fails to locate FindPahoMqttC.cmake.
This fix uses CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR to specify path to FindPahoMqttC.cmake relative to paho.mqtt.cpp'c root CMakeLists.txt.

…ncluded in a bigger project.

Signed-off-by: Vitaly Ogoltsov <vitaly.ogoltsov@me.com>
@fpagliughi
Copy link
Contributor

Thanks for the PR! It's probably better to work off the "develop" branch and submit commits back to "develop".

This issue was discussed in #172, and possibly fixed with 0d13c33 in the develop branch.

I'm not great with CMake, so let me know what you think of the different way I did it wit how you did it: PROJECT_SOURCE_DIR vs CMAKE_CURRENT_SOURCE_DIR.

@vogoltsov
Copy link
Contributor Author

@fpagliughi Oh, sorry about the branch - I'm more used to gitlab flow. I will mind that for future PRs.

You are correct, PROJECT_SOURCE_DIR should work the same as the project() is defined in a top-level CMakeLists.txt. Thank you!

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