You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This installation worked well, and I am successfully running Ros2 Jazzy on Mac M2 Sonoma 14.5, which is great.
When going through the official Ros2 Create Workspace tutorials, I started running into the following error related to a homebrew-installed Qt5 when trying to build a turtlesim package with colcon build:
-- Configuring incomplete, errors occurred!
--- stderr: turtlesim
CMake Error at CMakeLists.txt:16 (find_package):
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5" with any of
the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
---
Failed <<< turtlesim [6.65s, exited with code 1]
I was able to figure out a solution, SOLUTION HERE:
Run brew --prefix qt@5 to find your Qt5 installation directory. Save that full path for later.
Find and open the CMakeLists.txt file of the package you are installing. For turtlesim, it was in the src/ros_tutorials/turtlesim path relative to my workspace directory.
Add the following line to the CMakeLists.txt file, and save: set(CMAKE_PREFIX_PATH "{your_qt5_prefix_from_step_1}/lib/cmake")
Essentially you want to add the full path to the package's cmake directory to the CMAKE_PREFIX_PATH. For example, to resolve the error related to Qt5, I added the following line to the CMakeLists.txt file and saved: set(CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5/lib/cmake")
I've added that line closer to the top of the file, before all of the find_package statements.
And that's it! After this my package built successfully. This could potentially work for other CMakeLists.txt-related errors
The text was updated successfully, but these errors were encountered:
Hello!
This installation worked well, and I am successfully running Ros2 Jazzy on Mac M2 Sonoma 14.5, which is great.
When going through the official Ros2 Create Workspace tutorials, I started running into the following error related to a homebrew-installed Qt5 when trying to build a turtlesim package with
colcon build
:I was able to figure out a solution, SOLUTION HERE:
brew --prefix qt@5
to find your Qt5 installation directory. Save that full path for later.src/ros_tutorials/turtlesim
path relative to my workspace directory.set(CMAKE_PREFIX_PATH "{your_qt5_prefix_from_step_1}/lib/cmake")
Essentially you want to add the full path to the package's cmake directory to the CMAKE_PREFIX_PATH. For example, to resolve the error related to Qt5, I added the following line to the CMakeLists.txt file and saved:
set(CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5/lib/cmake")
I've added that line closer to the top of the file, before all of the
find_package
statements.And that's it! After this my package built successfully. This could potentially work for other CMakeLists.txt-related errors
The text was updated successfully, but these errors were encountered: