cmake: call cmake_minimum_required() before project()
When configuring with cmake 3.26.2 I saw the following error:
CMake Warning (dev) at CMakeLists.txt:1 (project):
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
Indeed, manual to cmake_minimum_required [1] specifies that
> Call the cmake_minimum_required() command at the beginning of the
> top-level CMakeLists.txt file even before calling the project()
> command. It is important to establish version and policy settings
> before invoking other commands whose behavior they may affect.
> See also policy CMP0000.
[1] https://cmake.org/cmake/help/v3.26/command/cmake_minimum_required.html
Change-Id: I34a205aab4c6937c672e2b43f85b63a2c7810d9d
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e151a3f..3db2bc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-project(netconf-cli LANGUAGES CXX)
cmake_minimum_required(VERSION 3.0)
+project(netconf-cli LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)