melrobin
(Melrobin)
December 29, 2021, 4:37am
1
I am having a good deal of trouble building ITK from development sources on Fedora 34. The problem occurs during Google Test detection. Here are the beginning of the errors:
CMake Error at CMake/ITKModuleTest.cmake:254 (include):
include could not find requested file:
GoogleTest
Call Stack (most recent call first):
Modules/Core/ImageAdaptors/test/CMakeLists.txt:31 (CreateGoogleTestDriver)
CMake Error at CMake/ITKModuleTest.cmake:254 (include):
include could not find requested file:
GoogleTest
Call Stack (most recent call first):
Modules/Filtering/ImageFilterBase/test/CMakeLists.txt:42 (CreateGoogleTestDriver)
CMake Error at CMake/ITKModuleTest.cmake:254 (include):
include could not find requested file:
CMake does pick up the correct directory, in this case /usr/lib64/cmake/GTest, but for some reason inexplicably fails.
Do you know what I can do to make some more progress?
dzenanz
(Dženan Zukić)
December 29, 2021, 2:40pm
2
Did you try turning ITK_USE_SYSTEM_GOOGLETEST
off? The version from OS might not play well with ITK, whereas the bundled version should.
melrobin
(Melrobin)
December 29, 2021, 3:16pm
3
Yes, it was off which is the default I think. I turned it on and the configure still failed.
dzenanz
(Dženan Zukić)
December 29, 2021, 3:18pm
4
Which version of ITK are you using?
melrobin
(Melrobin)
December 29, 2021, 3:29pm
5
I’m building from development sources.
dzenanz
(Dženan Zukić)
December 29, 2021, 4:02pm
6
@blowekamp you removed GoogleTest.cmake
in 6a6482a . What does include(GoogleTest) includes now?
blowekamp
(Bradley Lowekamp)
December 29, 2021, 4:33pm
7
The standard CMake modules should be used now for FindGTest , and GoogleTest .
The above seem to be the source of the problem. The CMake GoogleTest module is not available, it should be part of the CMake installation.
What version of CMake are you using?
Do you mean you are building from git master? or another version?
melrobin
(Melrobin)
December 29, 2021, 4:39pm
8
I’m using CMake 3.20.5 and am building from git master. I can try to reinstall CMake or try a later version.
blowekamp
(Bradley Lowekamp)
December 29, 2021, 5:05pm
9
The GoogleTest.cmake file should be installed in some place like: /usr/share/cmake-3.20/Modules/GoogleTest.cmake
melrobin
(Melrobin)
December 29, 2021, 5:09pm
10
OK, GoogleTest.cmake is missing. The Fedora package gtest-devel provides these files:
/usr/lib64/cmake/GTest/GTestConfig.cmake
/usr/lib64/cmake/GTest/GTestConfigVersion.cmake
/usr/lib64/cmake/GTest/GTestTargets-noconfig.cmake
/usr/lib64/cmake/GTest/GTestTargets.cmake
I have reinstalled CMake 3.20.5 and still do not have GoogleTest.cmake.
blowekamp
(Bradley Lowekamp)
December 29, 2021, 5:12pm
11
It should be part of CMake.
dzenanz
(Dženan Zukić)
December 29, 2021, 8:33pm
12
On my computer, it is in C:\Program Files\CMake\share\cmake-3.21\Modules\GoogleTest.cmake
.
melrobin
(Melrobin)
December 30, 2021, 2:12am
13
OK, thank you for your help. I reinstalled Fedora’s cmake-data package which restored GoogleTest.cmake to /usr/share/cmake/Modules.
2 Likes