CheckTypeSize.c.in does not exist
nmoinvaz opened this issue · 2 comments
nmoinvaz commented
When compiling curl
with cmake-checks-cache I get the following error:
-- Check size of sa_family_t
CMake Error: File /CheckTypeSize.c.in does not exist.
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CheckTypeSize.cmake:145 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.24/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl)
cmake-checks-cache/CMakeChecksCache/CheckTypeSize.cmake:31 (_check_type_size)
curl/CMakeLists.txt:1115 (check_type_size)
Looking at curl/CMakeCache.txt at 1115:
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T)
set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T})
set(CMAKE_EXTRA_INCLUDE_FILES "")
nmoinvaz commented
I tried to include these files in CMakeChecksCache
:
- https://raw.githubusercontent.com/Kitware/CMake/master/Modules/CheckTypeSize.c.in
- https://raw.githubusercontent.com/Kitware/CMake/master/Modules/CheckTypeSizeMap.cmake.in
But it does not appear to work because CMakeTypeSize.cmake
is looking for them in the current directory still.
cristianadam commented
In a Visual C++ 2022 developer console with CMake 3.24 I've tried:
C:/Projects/github
$ git clone https://github.com/cristianadam/cmake-checks-cache.git
$ git clone https://github.com/curl/curl.git
$ cmake -E time cmake -S curl -B build-curl-checks -DCMAKE_MODULE_PATH=c:/Projects/github/cmake-checks-cache/CMakeChecksCache -GNinja -DCMAKE_BUILD_TYPE=Release
$ cmake -E time cmake -S curl -B build-curl -C build-curl-checks\cmake_checks_cache.txt -GNinja -DCMAKE_BUILD_TYPE=Release
The time duration of the two configurations was:
Elapsed time: 70 s. (time), 69.505 s. (clock)
Elapsed time: 11 s. (time), 11.345 s. (clock)
Then I've build the two build directories, and the binaries were almost identical, except for the time stamps that the compiler sets.
The project works as expected. Check your CMake invocation.