NVIDIA-Omniverse / PhysX

NVIDIA PhysX SDK
BSD 3-Clause "New" or "Revised" License
2.54k stars 361 forks source link

Fix use of deprecated function exec_program in GetCompilerAndPlatform.cmake #288

Open carlossss111 opened 3 months ago

carlossss111 commented 3 months ago

Hi, I've been developing a project and have encountered this warning:

[cmake] CMake Warning (dev) at lib/physx-5.4.0/source/compiler/cmake/modules/GetCompilerAndPlatform.cmake:29 (EXEC_PROGRAM):
[cmake]   Policy CMP0153 is not set: The exec_program command should not be called.
[cmake]   Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
[cmake]   command to set the policy and suppress this warning.
[cmake] 
[cmake]   Use execute_process() instead.
[cmake] Call Stack (most recent call first):
[cmake]   lib/physx-5.4.0/source/compiler/cmake/modules/GetCompilerAndPlatform.cmake:87 (CompilerDumpVersion)
[cmake]   lib/physx-5.4.0/source/compiler/cmake/modules/GetCompilerAndPlatform.cmake:120 (GetCompiler)
[cmake]   lib/physx-5.4.0/source/compiler/cmake/modules/NvidiaBuildOptions.cmake:122 (GetPlatformBinName)
[cmake]   lib/physx-5.4.0/source/compiler/cmake/CMakeLists.txt:55 (INCLUDE)
[cmake] This warning is for project developers.  Use -Wno-dev to suppress it.

exec_program has been deprecated since CMAKE 3.0 in favour of execute_process, so this commit replaces it to avoid warnings and a future error. Thanks.

vreutskyy commented 3 months ago

Hi @carlossss111. Thanks for the report. We'll fix it.