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

Correctly set gtest 1.8 root directory #1014

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

dgossow
Copy link
Contributor

@dgossow dgossow commented Jul 5, 2019

In gtest version 1.8 or higher, there is a CMakeLists.txt in the
parent directory of the gtest source directory which we need to find.
This can be either /usr/src/googletest or ${CMAKE_SOURCE_DIR}/googletest.

The current version would only check in /usr/src/googletest even if
gtest was found in the project's src/ directory.

This would break the build on Ubuntu 18.04, where the system install of gmock
is version 1.8, if your project includes a newer version of gtest in its src/ directory.
The result would be that headers from src/ would be used, but the test
executables would be linked to the binaries from /usr/src.

@dgossow
Copy link
Contributor Author

dgossow commented Jul 5, 2019

@wjwwood @dirk-thomas Could you take a look at this?

@dgossow
Copy link
Contributor Author

dgossow commented Jul 7, 2019

The CI build fails like this:

Unable to download 3.4_with_system_site_packages archive. The archive may not exist. Please consider a different version.

Does not seem related though.

I still need to test this on Ubuntu 16.04 and 18.04 with and without gtest sources inside the workspace to make sure it works.

@dirk-thomas
Copy link
Member

dirk-thomas commented Jul 24, 2019

The CI build fails like this:

@dgossow Please rebase your change on top of the latest state of the target branch.

@dirk-thomas
Copy link
Member

@dgossow Friendly ping.

@dgossow dgossow force-pushed the kinetic-devel branch 2 times, most recently from f1d6ab9 to 4c1a324 Compare August 7, 2019 08:16
@dgossow
Copy link
Contributor Author

dgossow commented Aug 7, 2019

Sorry, I was distracted. So I essentially rebased this on top of kinetic-devel like requested.

I also tested this on 16.04 and 18.04.

16.04:
gtest found under /usr/src/gmock
gmock found under /usr/src/gmock

18.04:
gtest found under /usr/src/googletest
gmock found under /usr/src/googletest

Finding the current version (master) of gmock/gtest under src/googletest works in both cases.

In gtest version 1.8 or higher, there is a CMakeLists.txt in the
parent directory of the gtest source directory which we need to find.
This can be either /usr/src/googletest or
${CMAKE_SOURCE_DIR}/googletest.

The current version would only check in /usr/src/googletest even if
gtest was found in the project's src/ directory.

This would break the build on Ubuntu 18.04, where the system install of
gmock is version 1.8, if your project includes a newer version of gtest
in its src/ directory. The result would be that headers from src/ would
be used, but the test executables would be linked to the binaries from
/usr/src.
@dgossow
Copy link
Contributor Author

dgossow commented Aug 9, 2019

@dirk-thomas comments addressed

@dirk-thomas
Copy link
Member

Thanks for the patch.

@dirk-thomas dirk-thomas merged commit 2077375 into ros:kinetic-devel Aug 12, 2019
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