Skip to content

Commit

Permalink
CMake 3.23 and below compatibility.
Browse files Browse the repository at this point in the history
The build would fail with CMake 3.17 (for example), because CMake Policy
CMP0135 did not exist in CMake 3.23 and below.
  • Loading branch information
david-cattermole committed Jun 16, 2024
1 parent 60b1d9e commit 3aeab2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ cmake_policy(SET CMP0048 NEW)
# https://cmake.org/cmake/help/latest/policy/CMP0063.html
cmake_policy(SET CMP0063 NEW)

# Changes how timestamps of downloaded files with
# ExternalProject_Add() are set.
#
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
cmake_policy(SET CMP0135 NEW)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
# Changes how timestamps of downloaded files with
# ExternalProject_Add() are set.
#
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
cmake_policy(SET CMP0135 NEW)
endif()

# Do not allow using GNU extensions (such as '-std=g++11'), because
# it's not compatible with Maya.
Expand Down
12 changes: 7 additions & 5 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ cmake_policy(SET CMP0048 NEW)
# # https://cmake.org/cmake/help/latest/policy/CMP0063.html
# cmake_policy(SET CMP0063 NEW)

# Changes how timestamps of downloaded files with
# ExternalProject_Add() are set.
#
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
cmake_policy(SET CMP0135 NEW)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
# Changes how timestamps of downloaded files with
# ExternalProject_Add() are set.
#
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
cmake_policy(SET CMP0135 NEW)
endif()

# Do not allow using GNU extensions (such as '-std=g++11'), because
# it's not compatible with Maya.
Expand Down

0 comments on commit 3aeab2f

Please sign in to comment.