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 compile error regarding mqtt_cppConfig.cmake missing directories #507

Open
czkat opened this issue Dec 10, 2024 · 1 comment
Open

Comments

@czkat
Copy link

czkat commented Dec 10, 2024

Hi all I'm trying to install this on Ubuntu 24.04.1 LTS and encountered this error when I try to build with cmake. It seems to be a directory reference issue with mqtt_cpp because CMakeList.txt cannot find its configuration file mqtt_cppConfig.cmake and mqtt_cpp-config.cmake. I have modified the master file under /cppagent/CMakeList.txt to refer to this folder set(mqtt_cpp_iface_DIR "/usr/local/lib/cmake/mqtt_cpp_iface") and find_package(mqtt_cpp_iface REQUIRED) on the config file; declared the project and enable C and C++ project(MyProject LANGUAGES CXX C) . the initial error regarding the config file and the current error after I did all those above are pasted below. i hope i'm not getting into a deadlock/loop here.
note: agent_lib is a subdirectory under cppagent and has been added in the master CMakeList.txt file.

initial error:

cppagent$ cmake .
INFO Shared build: OFF
-- Found nlohmann_json: /usr/share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.11.3") 
CMake Error at agent_lib/CMakeLists.txt:299 (find_package):
  By not providing "Findmqtt_cpp.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "mqtt_cpp",
  but CMake did not find one.

  Could not find a package configuration file provided by "mqtt_cpp" with any
  of the following names:

    mqtt_cppConfig.cmake
    mqtt_cpp-config.cmake

  Add the installation prefix of "mqtt_cpp" to CMAKE_PREFIX_PATH or set
  "mqtt_cpp_DIR" to a directory containing one of the above files.  If
  "mqtt_cpp" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!

current error:

~/cppagent$ cmake .
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.74.0") found components: program_options 
INFO Shared build: OFF
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")  
CMake Error at agent_lib/CMakeLists.txt:299 (find_package):
  By not providing "Findmqtt_cpp.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "mqtt_cpp",
  but CMake did not find one.

  Could not find a package configuration file provided by "mqtt_cpp" with any
  of the following names:

    mqtt_cppConfig.cmake
    mqtt_cpp-config.cmake

  Add the installation prefix of "mqtt_cpp" to CMAKE_PREFIX_PATH or set
  "mqtt_cpp_DIR" to a directory containing one of the above files.  If
  "mqtt_cpp" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
@wsobel
Copy link
Member

wsobel commented Dec 11, 2024

Did you use Conan to build the project?

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