Set cmake_minimum_required first as recommended in the documentation

https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
"Note 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."

Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
This commit is contained in:
Pierre Hallot 2020-12-07 10:29:43 +01:00
parent 4dcfe5424f
commit ddb0f21ab5
No known key found for this signature in database
GPG Key ID: 43BB1CDDD7376D80

View File

@ -4,11 +4,10 @@
# To configure the build options either use the CMake gui, or run the command # To configure the build options either use the CMake gui, or run the command
# line utility including the "-i" option. # line utility including the "-i" option.
project(mosquitto)
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0042 NEW) cmake_policy(SET CMP0042 NEW)
project(mosquitto)
set (VERSION 2.0.2) set (VERSION 2.0.2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")