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

Freeglut build failure on CMake 4.0.0 #44195

Open
davegorst opened this issue Mar 6, 2025 · 2 comments
Open

Freeglut build failure on CMake 4.0.0 #44195

davegorst opened this issue Mar 6, 2025 · 2 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project

Comments

@davegorst
Copy link

Operating system

Windows 11

Compiler

MSVC

Steps to reproduce the behavior

./vcpkg install freeglut

Failure logs

"C:/Program Files/CMake/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "C:/Program Files/CMake/bin/cmake.exe" "C:/Users/dgors/source/repos/vcpkg/buildtrees/freeglut/src/v3.4.0-a667d9a2c9.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DFREEGLUT_BUILD_STATIC_LIBS=0" "-DFREEGLUT_BUILD_SHARED_LIBS=1" "-DFREEGLUT_REPLACE_GLUT=ON" "-DFREEGLUT_BUILD_DEMOS=OFF" "-DINSTALL_PDB=OFF" "-DCMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Users/dgors/source/repos/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/Users/dgors/source/repos/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/Users/dgors/source/repos/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/Users/dgors/source/repos/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
CMake Error at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.

C:\Users\dgors\source\repos\vcpkg>"C:/Program Files/CMake/bin/cmake.exe" -version
cmake version 4.0.0-rc2

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

Additional context

No response

@davegorst davegorst added the category:port-bug The issue is with a library, which is something the port should already support label Mar 6, 2025
@davegorst
Copy link
Author

It works if I force it to use downloaded binaries (not sure why it's not doing this by default) :

C:\Users\dgors\source\repos\vcpkg>set VCPKG_FORCE_DOWNLOADED_BINARIES=1

C:\Users\dgors\source\repos\vcpkg>vcpkg install freeglut
warning: The vcpkg C:\Users\dgors\source\repos\vcpkg\vcpkg.exe is using detected vcpkg root C:\Users\dgors\source\repos\vcpkg and ignoring mismatched VCPKG_ROOT environment value C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg. To suppress this message, unset the environment variable or use the --vcpkg-root command line switch.
Computing installation plan...
A suitable version of cmake was not found (required v3.30.1).
Downloading https://github.com/Kitware/CMake/releases/download/v3.30.1/cmake-3.30.1-windows-i386.zip -> cmake-3.30.1-windows-i386.zip
Successfully downloaded cmake-3.30.1-windows-i386.zip
Extracting cmake...
A suitable version of 7zip was not found (required v24.9.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.09/7z2409.exe -> 7z2409.7z.exe
Successfully downloaded 7z2409.7z.exe
Extracting 7zip...
A suitable version of 7zr was not found (required v24.9.0).
Downloading https://github.com/ip7z/7zip/releases/download/24.09/7zr.exe -> 44d8504a-7zr.exe
Successfully downloaded 44d8504a-7zr.exe
The following packages will be built and installed:
freeglut:[email protected]#3
Detecting compiler hash for triplet x64-windows...
A suitable version of git was not found (required v2.7.4).
Downloading https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/PortableGit-2.47.1.2-64-bit.7z.exe -> PortableGit-2.47.1.2-64-bit.7z.exe
Successfully downloaded PortableGit-2.47.1.2-64-bit.7z.exe
Extracting git...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\dgors\AppData\Local\vcpkg\archives in 213 us. Use --debug to see more details.
Installing 1/1 freeglut:[email protected]#3...
Building freeglut:[email protected]#3...
-- Using cached FreeGLUTProject-freeglut-v3.4.0.tar.gz
-- Cleaning sources at C:/Users/dgors/source/repos/vcpkg/buildtrees/freeglut/src/v3.4.0-a667d9a2c9.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/dgors/source/repos/vcpkg/downloads/FreeGLUTProject-freeglut-v3.4.0.tar.gz
-- Applying patch android.patch
-- Applying patch gles.patch
-- Applying patch x11-dependencies-export.patch
-- Applying patch fix-debug-macro.patch
-- Applying patch no_x64_enforcement.patch
-- Applying patch windows-output-name.patch
-- Using source at C:/Users/dgors/source/repos/vcpkg/buildtrees/freeglut/src/v3.4.0-a667d9a2c9.clean
-- Found external ninja('1.12.1').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Fixing pkgconfig file: C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/lib/pkgconfig/glut.pc
-- Using cached msys2-mingw-w64-x86_64-pkgconf-1~2.3.0-1-any.pkg.tar.zst
-- Using cached msys2-msys2-runtime-3.5.4-2-x86_64.pkg.tar.zst
-- Using msys root at C:/Users/dgors/source/repos/vcpkg/downloads/tools/msys2/21caed2f81ec917b
-- Fixing pkgconfig file: C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/debug/lib/pkgconfig/glut.pc
-- Installing: C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/share/glut/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/share/freeglut/usage
-- Installing: C:/Users/dgors/source/repos/vcpkg/packages/freeglut_x64-windows/share/freeglut/copyright
-- Performing post-build validation
Starting submission of freeglut:x64-windows to 1 binary cache(s) in the background
Elapsed time to handle freeglut:x64-windows: 11 s
freeglut:x64-windows package ABI: b43e079e93794697228140fa99ca48417fc9bf0b77b7c7bebdbcefd19f4e239e
Total install time: 11 s
freeglut provides CMake targets:

find_package(FreeGLUT CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:FreeGLUT::freeglut>,FreeGLUT::freeglut,FreeGLUT::freeglut_static>)

freeglut is compatible with built-in CMake targets:

find_package(GLUT REQUIRED)
target_link_libraries(main PRIVATE GLUT::GLUT)

Waiting for 1 remaining binary cache submissions...
Completed submission of freeglut:x64-windows to 1 binary cache(s) in 251 ms (1/1)

@Mengna-Li
Copy link
Contributor

@davegorst This is an error caused by the fact that cmake 4.0 is not compatible with cmake versions below 3.5. Can you submit this to upstream, the upstream needs to modify the minimum version limit of cmake.

@Mengna-Li Mengna-Li added the depends:upstream-changes Waiting on a change to the upstream project label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project
Projects
None yet
Development

No branches or pull requests

2 participants