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

GoogleTest target collisions when built as subproject #1139

Open
aliaksei135 opened this issue Apr 10, 2021 · 0 comments
Open

GoogleTest target collisions when built as subproject #1139

aliaksei135 opened this issue Apr 10, 2021 · 0 comments

Comments

@aliaksei135
Copy link

When a project using catkin is included as a subproject to a non catkin project, collisions for GoogleTest targets (GMock and GTest) can occur. catkin does not test if these targets already exist before trying to import them leading to traces similar to this:

CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3182 (add_custom_target):
  add_custom_target cannot create target "GMock" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory "/mnt/p/Dev/CLionProjects/uasgroundrisk".  See
  documentation for policy CMP0002 for more details.

This can be fixed by checking for existing targets before importing them.

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 a pull request may close this issue.

1 participant