[x265] [PATCH] Fix for CMake Errors in MacOS

Damiano Galassi galad87 at icloud.com
Fri Apr 4 14:04:55 UTC 2025


> Il giorno 4 apr 2025, alle ore 15:59, Yaswanth Sastry <yaswanth.sastry at multicorewareinc.com> ha scritto:
> 
> From bac7325fec4dacef7a3db8595f7b5afcd7a4b3a4 Mon Sep 17 00:00:00 2001
> From: yaswanthsastry <yaswanth.sastry at multicorewareinc.com>
> Date: Fri, 4 Apr 2025 14:11:08 +0530
> Subject: [PATCH] Fix for CMake Errors in MacOS
> 
> ---
>  source/CMakeLists.txt | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
> index 4f5b3ed82..fa4fb7036 100755
> --- a/source/CMakeLists.txt
> +++ b/source/CMakeLists.txt
> @@ -6,8 +6,10 @@ if(NOT CMAKE_BUILD_TYPE)
>          FORCE)
>  endif()
>  message(STATUS "cmake version ${CMAKE_VERSION}")
> -if(POLICY CMP0025)
> -    cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang
> +if(APPLE)
> +    if(POLICY CMP0025)
> +        cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang
> +    endif()

There is no need to set this policy, if you are just going to check for AppleClang below.
Setting CMP0025 to NEW (or even CMP0025 to NEW) does nothing at all on Cmake 4.

See the patch I sent some hours ago.

>  endif()
>  if(POLICY CMP0042)
>      cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
> @@ -17,7 +19,7 @@ if(POLICY CMP0054)
>  endif()
>   project (x265)
> -cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
> +cmake_minimum_required (VERSION 2.8.8...3.10) # OBJECT libraries require 2.8.8
>  include(CheckIncludeFiles)
>  include(CheckFunctionExists)
>  include(CheckSymbolExists)
> @@ -168,7 +170,7 @@ if(APPLE)
>    add_definitions(-DMACOS=1)
>  endif()
>  -if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
> +if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang|Clang")
>      set(CLANG 1)
>  endif()
>  if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
> --
> 2.37.3.windows.1
> 
> 
> 
> 
> <patch.diff>_______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel




More information about the x265-devel mailing list