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 conflict #28

Open
kapdon opened this issue Dec 7, 2022 · 1 comment
Open

cmake conflict #28

kapdon opened this issue Dec 7, 2022 · 1 comment

Comments

@kapdon
Copy link

kapdon commented Dec 7, 2022

Ubuntu 22.04

CMake Error at build/_deps/googletest-src/googlemock/CMakeLists.txt:98 (target_link_libraries):
  Attempt to add link library "gtest" to target "gmock" which is not built in
  this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:152 (add_library):
  add_library cannot create target "gmock_main" because another target with
  the same name already exists.  The existing target is a static library
  created in source directory "/home/dev/code/premia/src/lib/protobuf".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:205 (cxx_library_with_type)
  build/_deps/googletest-src/googlemock/CMakeLists.txt:100 (cxx_library)


CMake Error at build/_deps/googletest-src/googlemock/CMakeLists.txt:101 (target_link_libraries):
  The plain signature for target_link_libraries has already been used with
  the target "gmock_main".  All uses of target_link_libraries with a target
  must be either all-keyword or all-plain.

I think the submodules grpc's own cmake files is fighting with the project's own cmake files.

@barnix2020
Copy link

barnix2020 commented Feb 17, 2024

I have some error. Please help.:

CMake Error at build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:152 (add_library): add_library cannot create target "gmock" because another target with the same name already exists. The existing target is a static library created in source directory "/home/barnix/cpp/premia/src/lib/protobuf". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:205 (cxx_library_with_type) build/_deps/googletest-src/googlemock/CMakeLists.txt:97 (cxx_library)

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

2 participants