Skip to content
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

CMake error on INSTALL(EXPORT ...) when adding the mqtt_cpp package with CPM.cmake #989

Closed
lproj opened this issue Nov 13, 2023 · 5 comments

Comments

@lproj
Copy link

lproj commented Nov 13, 2023

Hi,

I've already opened a ticket on CPM.cmake regarding the issue below. Feel free to close this issue one if you think it is better to answer there.

With regard to the boost example in the CPM.cmake repository, I am trying to add a package right after the CPMAddPackage(NAME Boost ...) line:

set(MQTT_BUILD_EXAMPLES OFF CACHE BOOL "build mqtt_cpp examples" FORCE)
set(MQTT_BUILD_TESTS OFF CACHE BOOL "build mqtt_cpp tests" FORCE)
cpmaddpackage("gh:redboltz/mqtt_cpp#master")

However, I get this error when trying to build the project with cmake (from Ubuntu 22.04):

-- Configuring done
CMake Error: install(EXPORT "mqtt_cpp_ifaceTargets" ...) includes target "mqtt_cpp_iface" which requires target "boost_system" that is not in any export set.
CMake Error: install(EXPORT "mqtt_cpp_ifaceTargets" ...) includes target "mqtt_cpp_iface" which requires target "boost_date_time" that is not in any export set.

Do you know why this happens? It seems to me that the Boost targets do not get exported for some reasons.

Thanks in advance.

@redboltz
Copy link
Owner

I'm not sure why it happens but #990 would solve the issue. Please try it.
Boost.System was a normal library but now it is a header-only library. I'm not sure Boost.DataTime is the same situation.
But accoding to your log, only they output the error.

@lproj
Copy link
Author

lproj commented Nov 13, 2023

Installing mqtt_cpp#fix_989 works, thanks. I've provided more details as a comment on #990 .

...
-- CPM: Adding package mqtt_cpp@ (fix_989)
-- Setting minimum C++ standard to C++14
-- TLS disabled
-- WebSocket disabled
-- Always send reason code enabled
-- UTF8String check enabled
-- Using boost::variant instead of std::variant
-- Using boost::optional instead of std::optional
-- Using boost::string_view instead of std::string_view
-- Using boost::any instead of std::any
-- Using boost::shared_ptr<char []> instead of std::shared_ptr<char []>
-- std::tuplestd::any workaround for libstdc++ enabled
-- Dynamically linking with Boost
-- Dynamically linking with Openssl
-- Logging disabled
-- Configuring done
-- Generating done
...

@redboltz
Copy link
Owner

redboltz commented Nov 13, 2023

Thanks.
Unfortunately, CI failed. In order to merge #990, CI should be passed.
https://github.com/redboltz/mqtt_cpp/actions/runs/6850513492/job/18624825988?pr=990

I have no time to solve it serveral weeks, sorry.
If someone fix the CI issue, please create the PR based on fix_989 branch.

redboltz added a commit that referenced this issue Nov 14, 2023
@redboltz
Copy link
Owner

I got a time by chance, so I have fixed the CI issue.

@lproj
Copy link
Author

lproj commented Nov 16, 2023

Thanks for you help and keep up the good work!

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

No branches or pull requests

2 participants