cmake: set CMP0054 to NEW to avoid variables over expansion (since cmake 3.8)

==> win: CMake Warning (dev) at CMakeLists.txt:782 (elseif):
==> win:   Policy CMP0054 is not set: Only interpret if() arguments as variables or
==> win:   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
==> win:   details.  Use the cmake_policy command to set the policy and suppress this
==> win:   warning.
==> win:
==> win:   Quoted variables like "MSVC" will no longer be dereferenced when the policy
==> win:   is set to NEW.  Since the policy is not set the OLD behavior will be used.
==> win: This warning is for project developers.  Use -Wno-dev to suppress it.

(cherry picked from commit 2773a5ed5e75540d43500e054581ea1fab2132ac)
This commit is contained in:
Azat Khuzhin 2017-05-29 18:48:48 +03:00 committed by Azat Khuzhin
parent 3e69029008
commit 6f74954017
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -23,6 +23,7 @@ if (APPLE)
else()
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
endif()
cmake_policy(SET CMP0054 NEW)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release
@ -776,8 +777,8 @@ source_group("Source Extra" FILES ${SRC_EXTRA})
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
if ((CMAKE_COMPILER_IS_GNUCC) OR
(${CMAKE_C_COMPILER_ID} STREQUAL "Clang") OR
(${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang"))
("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR
("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang"))
set(EVENT_SHARED_FLAGS -fvisibility=hidden)
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro")
set(EVENT_SHARED_FLAGS -xldscope=hidden)