CMake: call cmake_minimum_required before project
cmake_minimum_required() MUST be called even before project(), otherwise some policies will not be correctly set. On the macOS build on Travis for example, CMP0025 was accidentally set to "OLD" which resulted in CMAKE_C_COMPILER_ID being reported as "Clang" instead of "AppleClang". Change-Id: I20065e621628cde24946edb519d719f527936d87 Reviewed-on: https://code.wireshark.org/review/30685 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
93361b9977
commit
923d719f2b
|
@ -7,6 +7,12 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
|
||||
if(WIN32)
|
||||
# Needed for GREATER_EQUAL operator
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
endif()
|
||||
project(Wireshark C CXX)
|
||||
|
||||
# Updated by make-version.pl
|
||||
|
@ -34,12 +40,6 @@ endif()
|
|||
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
|
||||
message(STATUS "Generating build using CMake ${CMAKE_VERSION}")
|
||||
if(WIN32)
|
||||
# Needed for GREATER_EQUAL operator
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
endif()
|
||||
|
||||
#Where to find local cmake scripts
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
|
|
Loading…
Reference in New Issue