Skip to content

Commit 5c77be1

Browse files
committed
Update bootstrap_deps.cmake
1 parent 9b05734 commit 5c77be1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

resources/cmake/bootstrap_deps.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ if(WIN32 AND EXISTS "${glew_SOURCE_DIR}/build/glew.rc")
120120
file(WRITE "${glew_SOURCE_DIR}/build/glew.rc" "// intentionally blank\n")
121121
endif()
122122

123+
# glew-cmake 2.2.0 declares cmake_minimum_required(VERSION 2.8.12) which
124+
# CMake 4.x no longer accepts. Bump it to 3.5 in-place before the build.
125+
if(WIN32 AND EXISTS "${glew_SOURCE_DIR}/CMakeLists.txt")
126+
file(READ "${glew_SOURCE_DIR}/CMakeLists.txt" _glew_content)
127+
string(REGEX REPLACE
128+
"cmake_minimum_required[ \t]*\\([ \t]*VERSION[ \t]+[0-9]+\\.[0-9]+(\\.[0-9]+)?[ \t]*\\)"
129+
"cmake_minimum_required(VERSION 3.5)"
130+
_glew_content "${_glew_content}"
131+
)
132+
file(WRITE "${glew_SOURCE_DIR}/CMakeLists.txt" "${_glew_content}")
133+
unset(_glew_content)
134+
endif()
135+
123136
# ============================================================================
124137
# Download deferred dependencies (SOURCE_SUBDIR fakedir = download only)
125138
# ============================================================================

0 commit comments

Comments
 (0)