2025-06-04 3:56 AM
Hi,
I try to compile "OpenAMP_TTY_echo_CM33_NonSecure" sample program as suggested here:
Compiling does not work, I get error message:
0:43:14 **** Build of configuration CA35TDCID_m33_ns_sign for project OpenAMP_TTY_echo_CM33_NonSecure ****
make -j16 all
cmake -S ../../../../../../../../../Middlewares/Third_Party/OpenAMP/libmetal/ -B libmetal -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=cmake/platforms/stm32mp-generic-gcc.cmake
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
-- Configuring incomplete, errors occurred!
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
make[1]: *** [makefile:104: pre-build] Error 1
make: *** [makefile:72: all] Error 2
"make -j16 all" terminated with exit code 2. Build might be incomplete.
10:43:15 Build Failed. 2 errors, 0 warnings. (took 626ms)
-------------------
I have cmake 4.0.2 installed. I tried in Ubuntu and Windows, same error.
Can you please help?
2025-06-19 2:51 AM - edited 2025-06-19 2:51 AM
Hi @nh7 ,
You can add argument as -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to the command as shown in the error or you can use cmake version 3.XX (For example 3.31.6).
2025-06-19 2:55 AM
Thanks for sharing the detailed error log it definitely helps narrow things down. The issue seems to stem from a mismatch between the CMakeLists.txt in the OpenAMP project and the newer version of CMake you're using (v4.0.2). Some older CMake scripts expect backward compatibility, which is stricter in newer versions.
You could try one of the following:
Edit the CMakeLists.txt file and update the cmake_minimum_required(VERSION ...) line to reflect your version e.g., cmake_minimum_required(VERSION 3.5...4.0).
Add this to your build command:
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
This might bypass the policy version check.
Alternatively, if possible, try using an older version of CMake (e.g., 3.22) that's known to work with STM32CubeIDE and OpenAMP projects. Sometimes that's the quickest workaround.