CMake warning about exec_program

This came up when doing an incremental build, but removing the build directory generated more warnings. They all look about the same:

CMake Warning (dev) at packages/protobufs/CMakeLists.txt:111 (exec_program):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead
This warning is for project developers.  Use -Wno-dev to suppress it.

It is not protofubs only, the other source of warnings is FindLibUUID.cmake:

CMake Warning (dev) at packages/clib/cmake/FindLibUUID.cmake:17 (exec_program)
...

This is my cmake:

$ cmake --version
cmake version 3.28.0

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

The referenced execute_process() seems to be a drop in replacement for exec_program but it is hard for me to tell since I have never used CMake.

Thanks for reporting. Except for a little different command syntax the change was easy. Should work (tested to work only with 3.27).

1 Like

Tested with cmake 3.18.4 (which is what my Debian/Chromebook has by default).

1 Like