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

GTest configuration fails as of CPM version 0.40.1 #603

Open
DNKpp opened this issue Sep 20, 2024 · 2 comments · May be fixed by #605
Open

GTest configuration fails as of CPM version 0.40.1 #603

DNKpp opened this issue Sep 20, 2024 · 2 comments · May be fixed by #605

Comments

@DNKpp
Copy link
Contributor

DNKpp commented Sep 20, 2024

As the title already states, my project fails configuring when upgrading CPM to Version 0.40.1 and beyond, due to this error:

1> [CMake] CMake Error: File /home/dnkpp/.vs/cpm_test/952dbcb6-53c6-4ed1-b2ba-4d91dcbd3971/out/build/Linux-Clang-Debug/_deps/gtest-src/cmake/Config.cmake.in does not exist.
1> [CMake] CMake Error at /usr/local/share/cmake-3.28/Modules/CMakePackageConfigHelpers.cmake:344 (configure_file):
1> [CMake]   configure_file Problem configuring file
1> [CMake] Call Stack (most recent call first):
1> [CMake]   /home/dnkpp/.vs/cpm_test/952dbcb6-53c6-4ed1-b2ba-4d91dcbd3971/out/build/Linux-Clang-Debug/_deps/gtest-src/googletest/CMakeLists.txt:102 (configure_package_config_file)
1> [CMake] -- Configuring incomplete, errors occurred!

This is just the output from my minimal example. If you want to have a look at my actual project output, here is the relevant gh-action run: https://github.com/DNKpp/mimicpp/actions/runs/10965745313
This happens to be the case for all linux based machines, I've tested it (also some local docker containers).

I'll attach the minimal example: cpm_test.zip

@Avus-c
Copy link
Contributor

Avus-c commented Sep 25, 2024

This is a bug in CMake which was resolved in version 3.30.3: CMake Issue 26243. The bug also affects older versions of CMake.

For context: CMake 3.30 deprecates a function signature that CPM versions earlier than 0.40.1 used to add packages. This was addressed in CPM 0.40.1 to align with CMake's new expectations. See pr #570 for more details.

When I implemented the fixes in #570, I aimed to use the "new method" with the earliest CMake version that supported it, which was 3.28. However, now that I’m aware of the bug in these versions, I think it would be the best to update the version checks from 3.28 to 3.30, where the deprecation warnings actually begin. Although CMake versions 3.30.0 - 3.30.2 still contain the bug, it's easier to upgrade from 3.30.0 to 3.30.3 than from 3.28 to 3.30.3.

PS:
Windows should also be effected. The log from your action looked weird: CPM: Adding package GTest@0 (1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2). Haven't looked further, maybe it's expected :)

@Avus-c Avus-c linked a pull request Sep 25, 2024 that will close this issue
@DNKpp
Copy link
Contributor Author

DNKpp commented Sep 25, 2024

Thank you for your explanation, but unfortunantly I have still no idea how that can be the root cause for the non-existing input template. But either way. If it's the reason, I'm fine with the fix :) Thank you!

Windows should also be effected. The log from your action looked weird: CPM: Adding package GTest@0 (1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2). Haven't looked further, maybe it's expected :)

Well, I don't think so. In that runner I've selected an actual git commit hash. Seems fine too me. But as I use gtest just for the dedicated adapter test, I use the very minimal of it. For my actual unit-test I'm using catch2.

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.

2 participants