ROS2 - colcon build fails to find configuration file provided by "ament_cmake"
I'm currently doing the ROS2 tutorial on Windows 10: "Creating a workspace" (https://index.ros.org/doc/ros2/Tutori...) using Ros2_foxy. So I'm a beginner.
However, upon trying to build the workspace with colcon, I get the following error:
PS C:\dev_ws\ colcon build - -merge -install
Starting turtlesim
--- stderr: turtlesim
CMake Error at CMakeLists . txt:12 (find_package):
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ament_cmake", but CMake did not find one.
Could not find a package configuration file provided by " ament_cmake" with any of the following names:
ament_cmakeConfig.cmake
ament_cmake-config.cmake
Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH" or set "ament_cmake DIR" to a directory containing one of the above files. If "ament_cmake" provides a separate development package or SDK, be sure it has been installed.
It would seem that I need to change my PATH to include the ament files, but I have no idea where to find them. I reinstalled CMake using Chocolatey, but that didn't solve it. And of course I'm sourcing ROS in my terminal.
Any ideas on how to solve this?
Why did you delete your question?
If you have solved it, please post an answer yourself.
That way we can help future users to avoid this.
I deleted it because I have no clue what solved it. I came back into work the next day, tried it again, and it worked. I really don't know why, as I already rebooted the day before as well... I didn't want others wasting their time on my question, so I thought deleting it would be more appropriate in this case. Should I keep it open?
I would still suggest you post that as an answer.
It's not a good one, but it is an answer, and it did 'solve' your problem.