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

[BUG] Gmock target not found #36

Open
radupaulstefan opened this issue Mar 19, 2022 · 2 comments
Open

[BUG] Gmock target not found #36

radupaulstefan opened this issue Mar 19, 2022 · 2 comments
Assignees
Labels
acknowledged The issue is being worked on bug Something isn't working

Comments

@radupaulstefan
Copy link

Describe the bug
Starting from fresh template, if use gmock option is selected, cmake generate fails.

To Reproduce
Steps to reproduce the behavior:

  1. Open './cmake/StandardSettings.cmake'
  2. Scroll down to 'option(${PROJECT_NAME}_USE_GOOGLE_MOCK "Use the GoogleMock project for extending the unit tests." OFF)'
  3. Modify OFF -> ON (activate gmock)
  4. Try to generate cmake
  5. See error Target "tmp_test_Tests" links to target ""GTest::gmock" but the target was not found"
  6. See error Target "tmp_test_Tests" links to target ""GTest::gmock_main" but the target was not found"

Expected behavior
Generation should work without any error

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu (WSL 2)
  • Version 20.04

Additional context

@radupaulstefan radupaulstefan added the bug Something isn't working label Mar 19, 2022
@radupaulstefan radupaulstefan changed the title Gmock target not found [BUG] [BUG] Gmock target not found Mar 19, 2022
@radupaulstefan
Copy link
Author

Worked for me with this change:
test/CMakeLists.txt line 49
set(GOOGLE_MOCK_LIBRARIES GTest::gmock GTest::gmock_main) -> set(GOOGLE_MOCK_LIBRARIES gmock)

If this is really a bug and not an issue with my environment (some missing or not installed correctly dependency) I can make a PR with a fix.

@filipdutescu filipdutescu self-assigned this May 17, 2022
@filipdutescu
Copy link
Owner

Hello, thanks for reporting this bug! I am not sure it was not due to you not having GMock installed globally on your environment, in an accessible path, as that is the intended way it should be used. Have you tried using the dockerfile to see if in the container everything works as intended? If not, you might be right and there is a mistake made in the linking part.

@filipdutescu filipdutescu added the acknowledged The issue is being worked on label May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged The issue is being worked on bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants