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

tests: allow using system gtest copy #113

Merged
merged 1 commit into from
Nov 19, 2022
Merged

tests: allow using system gtest copy #113

merged 1 commit into from
Nov 19, 2022

Conversation

thesamesam
Copy link
Contributor

Distributions often do builds with no network access available for both security reasons and also to ensure reproducibility.

This change tells CMake to query the system for a copy of gtest, but if it's not available, it'll fall back to downloading via FetchContent.

Distributions often do builds with no network access available
for both security reasons and also to ensure reproducibility.

This change tells CMake to query the system for a copy of gtest,
but if it's not available, it'll fall back to downloading via
FetchContent.
@serge1
Copy link
Owner

serge1 commented Nov 19, 2022

Accepted. Thank you!

@serge1 serge1 merged commit a52cccf into serge1:main Nov 19, 2022
@thesamesam thesamesam deleted the gtest-system branch November 19, 2022 12:27
@thesamesam
Copy link
Contributor Author

Thanks!

@serge1
Copy link
Owner

serge1 commented Nov 19, 2022

Unfortunately, the change does not go plain. Here is my build log:

user@linux-on-jaguar:/.local/share/Trash/files$ cd /ELFIO/
user@linux-on-jaguar:
/ELFIO$ mkdir build && cd build
user@linux-on-jaguar:
/ELFIO/build$ cmake .. -DELFIO_BUILD_TESTS=ON
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2806 (message):
At least one entry of URL is a path (invalid in a list)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/ExternalProject.cmake:3716 (_ep_add_download_command)
CMakeLists.txt:15 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!
See also "/home/user/ELFIO/build/_deps/googletest-subbuild/CMakeFiles/CMakeOutput.log".

CMake Error at /usr/share/cmake-3.22/Modules/FetchContent.cmake:1075 (message):
CMake step for googletest failed: 1
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
/usr/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language)
/usr/share/cmake-3.22/Modules/FetchContent.cmake:1259 (FetchContent_Populate)
tests/CMakeLists.txt:12 (FetchContent_MakeAvailable)

-- Configuring incomplete, errors occurred!
See also "/home/user/ELFIO/build/CMakeFiles/CMakeOutput.log".

@serge1
Copy link
Owner

serge1 commented Nov 19, 2022

I have reverted the change for the meantime. Please resubmit after the fix

@thesamesam
Copy link
Contributor Author

Thanks, I'll give it another look, it definitely fetched for me.

@serge1
Copy link
Owner

serge1 commented Nov 19, 2022

While testing, please don't forget to turn on the testing: ELFIO_BUILD_TESTS=ON

@thesamesam
Copy link
Contributor Author

Oh dear. It's because it needs CMake 3.24 minimum.

@serge1
Copy link
Owner

serge1 commented Dec 15, 2022

The library switched to a newer 'googletest' archive with your change in

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