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

Fix finding gtest and gmock in cmake. #1198

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

hgaiser
Copy link

@hgaiser hgaiser commented Aug 20, 2024

This PR is to update how GTest and GMock are found using CMake. The old way has issues with system installed versions of these packages (see here).

@lprobsth
Copy link

This patch fixes an error when building ros-noetic-catkin on arch linux with cmake version 3.30.2.

Log from makepkg
==> Making package: ros-noetic-catkin 0.8.10-3 (Mi 28 Aug 2024 22:54:12 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ros-noetic-catkin-0.8.10.tar.gz
==> Validating source files with sha256sums...
    ros-noetic-catkin-0.8.10.tar.gz ... Passed
==> Extracting sources...
  -> Extracting ros-noetic-catkin-0.8.10.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using CATKIN_DEVEL_PREFIX: /home/lprobsth/.cache/yay/ros-noetic-catkin/src/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
CMake Warning (dev) at cmake/python.cmake:4 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  cmake/all.cmake:164 (include)
  CMakeLists.txt:8 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using default Python package layout
-- Using empy: /usr/lib/python3.12/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/lprobsth/.cache/yay/ros-noetic-catkin/src/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
CMake Warning at /usr/src/gmock/CMakeLists.txt:40 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.


CMake Warning at /usr/src/googletest/CMakeLists.txt:50 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.


CMake Error at /usr/src/googletest/CMakeLists.txt:124 (set_target_properties):
  set_target_properties called with incorrect number of arguments.


CMake Error at /usr/src/googletest/CMakeLists.txt:142 (set_target_properties):
  set_target_properties called with incorrect number of arguments.


CMake Error at /usr/src/gmock/CMakeLists.txt:99 (set_target_properties):
  set_target_properties called with incorrect number of arguments.


CMake Error at /usr/src/gmock/CMakeLists.txt:102 (set_target_properties):
  set_target_properties called with incorrect number of arguments.


-- Using Python nosetests: /usr/bin/nosetests-3.12
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().
    Aborting...

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

Successfully merging this pull request may close these issues.

2 participants