-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #3760 #3974
Fix issue #3760 #3974
Conversation
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
I detected other pull requests that are modifying paho-mqtt-c/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
1 similar comment
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
recipes/paho-mqtt-c/all/conanfile.py
Outdated
self.cpp_info.names["cmake_find_package"] = "eclipse-paho-mqtt-c" | ||
self.cpp_info.names["cmake_find_package_multi"] = "eclipse-paho-mqtt-c" | ||
self.cpp_info.names["cmake_find_package"] = "PahoMqttC" | ||
self.cpp_info.names["cmake_find_package_multi"] = "PahoMqttC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that paho-mqtt-c
does not install cmake modules itself. So we don't know what the correct name is.
Granted, paho-mqtt-cpp
uses PahoMqttC
, but that's not official either.
There is no good solution ATM.
Conan should have a feature to rename these components for consumers.
Could you please add a comment/FIXME, saying that this name is used by paho-mqtt-cpp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Croydon has better eyesight then me apparently. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like CMakeLists.txt from paho-mqtt-cpp is looking for PahoMqttC. I think this is where the error is coming from if set like this:
self.cpp_info.names["cmake_find_package"] = "eclipse-paho-mqtt-c"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It packs its own cmake module: https://github.com/eclipse/paho.mqtt.cpp/blob/a2e66455337a7e40277ca65ef2a3b045eb223c30/cmake/FindPahoMqttC.cmake
But that probably doesn't work with a static paho-mqtt-c library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're seeing this problem: eclipse-paho/paho.mqtt.cpp#264
I think the correct solution is to fix their cmake script and use the exported targets of paho.mqtt.c.
If you write the patch on top of their current master, maybe they accept it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I'll have to take a look at the paho.mqtt.cpp issue. Thanks,
|
||
if(PAHO_MQTT_C_ASYNC) | ||
add_executable(${PROJECT_NAME} test_package_async.c) | ||
if(PAHO_MQTT_C_WITH_SSL) | ||
if(PAHO_MQTT_C_SHARED) | ||
target_link_libraries(${PROJECT_NAME} eclipse-paho-mqtt-c::paho-mqtt3as) | ||
target_link_libraries(${PROJECT_NAME} PahoMqttC::paho-mqtt3as) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested, but I think you can get away with using PahoMqttC::PahoMqttC
.
That target will include all components (shared or static).
(I'm not 100% sure though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? Seems a bit redundant but it works with different build options.
if(PAHO_MQTT_C_ASYNC)
add_executable(${PROJECT_NAME} test_package_async.c)
if(PAHO_MQTT_C_WITH_SSL)
if(PAHO_MQTT_C_SHARED)
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
else()
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
endif()
else()
if(PAHO_MQTT_C_SHARED)
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
else()
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
endif()
endif()
else()
add_executable(${PROJECT_NAME} test_package_client.c)
if(PAHO_MQTT_C_WITH_SSL)
if(PAHO_MQTT_C_SHARED)
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
else()
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
endif()
else()
if(PAHO_MQTT_C_SHARED)
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
else()
target_link_libraries(${PROJECT_NAME} PahoMqttC::PahoMqttC)
endif()
endif()
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the conditionals anymore.
But maybe ignore my suggestion and keep it as it was.
The test_package is testing the static/shared targets.
Let's keep it since it's not broken.
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
3 similar comments
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
|
||
IF (NOT WIN32) | ||
- SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) | ||
+ SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a-static) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a patch, it's also perfectly fine to only add the -static
suffix in package_info
when on Windows.
e.g.
if not self.options.shared and self.settings.os == "Windows":
target += "-static"
This is probably done to avoid mixing up a static library and an import library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this suppose to change the generated library name? There is already a _cmake_target defined but it doesn't appear to change the generated library name. I also don't know if -static needs to be added for a windows build. The _cmake_target hints that does need -static for windows.
self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package"] = self._cmake_target
self.cpp_info.components["_paho-mqtt-c"].names["cmake_find_package_multi"] = self._cmake_target
def _cmake_target(self):
target = "paho-mqtt3"
target += "a" if self.options.asynchronous else "c"
if self.options.ssl:
target += "s"
if not self.options.shared:
target += "-static"
return target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OUTPUT_NAME
sets the name of the output file.
You can do something as follows (untested):
def _cmake_target(self):
target = "paho-mqtt3"
target += "a" if self.options.asynchronous else "c"
if self.options.ssl:
target += "s"
if self.settings.os != "Windows" and not self.options.shared:
target += "-static"
return target
Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue. |
config.yml syntax error in build 9:
|
I have closed #3834 since there is now 1.3.8 and this should be used, 1.3.6 has. known bugs and limitations. |
config.yml syntax error in build 10:
|
I'm going to rework this. Closing. |
Specify library name and version: paho-mqtt-c/1.3.5
conan-center hook activated.