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

Too old CMake version warning #642

Closed
mcuee opened this issue Nov 16, 2023 · 2 comments · Fixed by #663
Closed

Too old CMake version warning #642

mcuee opened this issue Nov 16, 2023 · 2 comments · Fixed by #663
Labels
build system/CI Anything related to building the project or running on CI CMake Related to CMake build system

Comments

@mcuee
Copy link
Member

mcuee commented Nov 16, 2023

Currently hidapi seems to detect my MSYS2 mingw64 CMake version wrongly.

 MINGW64 /c/work/hid/hidapi

$ cmake --version
cmake version 3.27.7

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ cmake -B build_mingw -D HIDAPI_WITH_TESTS=ON -D CMAKE_VERBOSE_MAKEFILE=ON
-- Building for: Ninja
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- hidapi: v0.14.0
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: C:/work/hid/hidapi/build_mingw

$ cmake --build build_mingw
Change Dir: 'C:/work/hid/hidapi/build_mingw'

Run Build Command(s): C:/msys64/mingw64/bin/ninja.exe -v
[1/6] C:\msys64\mingw64\bin\windres.exe -O coff -Dhidapi_winapi_EXPORTS -I C:/work/hid/hidapi/hidapi -I C:/work/hid/hidapi/windows  C:/work/hid/hidapi/windows/hidapi.rc src/windows/CMakeFiles/hidapi_winapi.dir/hidapi.rc.obj
[2/6] C:\msys64\mingw64\bin\cc.exe  -IC:/work/hid/hidapi/hidapi -IC:/work/hid/hidapi/windows -O3 -DNDEBUG -std=gnu11 -MD -MT src/windows/test/CMakeFiles/hid_report_reconstructor_test.dir/hid_report_reconstructor_test.c.obj -MF src\windows\test\CMakeFiles\hid_report_reconstructor_test.dir\hid_report_reconstructor_test.c.obj.d -o src/windows/test/CMakeFiles/hid_report_reconstructor_test.dir/hid_report_reconstructor_test.c.obj -c C:/work/hid/hidapi/windows/test/hid_report_reconstructor_test.c
[3/6] C:\msys64\mingw64\bin\cc.exe -Dhidapi_winapi_EXPORTS -IC:/work/hid/hidapi/hidapi -IC:/work/hid/hidapi/windows -O3 -DNDEBUG -MD -MT src/windows/CMakeFiles/hidapi_winapi.dir/hid.c.obj -MF src\windows\CMakeFiles\hidapi_winapi.dir\hid.c.obj.d -o src/windows/CMakeFiles/hidapi_winapi.dir/hid.c.obj -c C:/work/hid/hidapi/windows/hid.c
[4/6] C:\msys64\mingw64\bin\cc.exe -Dhidapi_winapi_EXPORTS -IC:/work/hid/hidapi/hidapi -IC:/work/hid/hidapi/windows -O3 -DNDEBUG -MD -MT src/windows/CMakeFiles/hidapi_winapi.dir/hidapi_descriptor_reconstruct.c.obj -MF src\windows\CMakeFiles\hidapi_winapi.dir\hidapi_descriptor_reconstruct.c.obj.d -o src/windows/CMakeFiles/hidapi_winapi.dir/hidapi_descriptor_reconstruct.c.obj -c C:/work/hid/hidapi/windows/hidapi_descriptor_reconstruct.c
[5/6] cmd.exe /C "cd . && C:\msys64\mingw64\bin\cc.exe -O3 -DNDEBUG   -shared -o src\windows\libhidapi.dll -Wl,--out-implib,src\windows\libhidapi.dll.a -Wl,--major-image-version,0,--minor-image-version,14 src/windows/CMakeFiles/hidapi_winapi.dir/hid.c.obj src/windows/CMakeFiles/hidapi_winapi.dir/hidapi_descriptor_reconstruct.c.obj src/windows/CMakeFiles/hidapi_winapi.dir/hidapi.rc.obj  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
[6/6] cmd.exe /C "cd . && C:\msys64\mingw64\bin\cc.exe -O3 -DNDEBUG  src/windows/test/CMakeFiles/hid_report_reconstructor_test.dir/hid_report_reconstructor_test.c.obj -o src\windows\test\hid_report_reconstructor_test.exe -Wl,--out-implib,src\windows\test\libhid_report_reconstructor_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0  src/windows/libhidapi.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
@mcuee mcuee added build system/CI Anything related to building the project or running on CI CMake Related to CMake build system labels Nov 16, 2023
@Youw Youw changed the title Wrong CMake version detection Too old CMake version warning Nov 16, 2023
@mcuee
Copy link
Member Author

mcuee commented Mar 5, 2024

Same issue with cmake version 3.28.1 under MSYS2 mingw64.

$ cmake -B build
-- Building for: Ninja
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- hidapi: v0.14.0
-- Configuring done (4.9s)
-- Generating done (0.0s)
-- Build files have been written to: C:/work/libusb/hidapi/build

$ cmake --build build
[4/4] Linking C shared library src\windows\libhidapi.dll

$ cmake --version
cmake version 3.28.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@mcuee
Copy link
Member Author

mcuee commented Mar 5, 2024

No issue with VS2019 cmake.

PS C:\work\libusb\hidapi> cmake -B build_vs2019
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30153.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- hidapi: v0.14.0
-- Configuring done
-- Generating done
-- Build files have been written to: C:/work/libusb/hidapi/build_vs2019
PS C:\work\libusb\hidapi> cmake --build .\build_vs2019 --config Release
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/work/libusb/hidapi/windows/CMakeLists.txt
  hid.c
  hidapi_descriptor_reconstruct.c
  Generating Code...
     Creating library C:/work/libusb/hidapi/build_vs2019/src/windows/Release/hidapi.lib and object C:/work/libusb/hidap
  i/build_vs2019/src/windows/Release/hidapi.exp
  hidapi_winapi.vcxproj -> C:\work\libusb\hidapi\build_vs2019\src\windows\Release\hidapi.dll
  Building Custom Rule C:/work/libusb/hidapi/CMakeLists.txt
PS C:\work\libusb\hidapi> cmake --version
cmake version 3.20.21032501-MSVC_2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@Youw Youw closed this as completed in #663 Mar 5, 2024
Youw added a commit that referenced this issue Mar 5, 2024
Avoid a message:
```
Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
```

Fixes: #642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system/CI Anything related to building the project or running on CI CMake Related to CMake build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant