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: Cannot find package ament_gmock #194

Open
MoonBite666 opened this issue Apr 2, 2024 · 2 comments
Open

CMake Error: Cannot find package ament_gmock #194

MoonBite666 opened this issue Apr 2, 2024 · 2 comments

Comments

@MoonBite666
Copy link

After setting up the robot controller using the rtw command:
ros2_control_setup-hardware-interface-package dofbot_hardware DofHW
and inputing some information,
the colcon build gives a CMake Error:

CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "Findament_gmock.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_gmock", but CMake did not find one.

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

    ament_gmockConfig.cmake
    ament_gmock-config.cmake

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

the apt shows that I have downloaded ros gmock.

ros-humble-ament-cmake-gmock/jammy,now 1.3.8-1jammy.20240217.024747 amd64 [已安装,自动]
  The ability to add Google mock-based tests in the ament buildsystem in CMake.

ros-humble-gmock-vendor/jammy,now 1.10.9004-4jammy.20240217.024718 amd64 [已安装,自动]
  The package provides GoogleMock.

Is there any missing packages?

@mamueluth
Copy link
Member

its probably not in the package.xml
have to check the generation scripts

@eholandcmu
Copy link

eholandcmu commented Apr 22, 2024

I have the same issue. A temporary fix was to comment out the if(BUILD_TESTING) section/ in CMakeLists.txt. This allows the package to build, but I imagine it is not an ideal solution as you lose that functionality.

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

3 participants