Consolidate and simplify CMAKE_POLICY entries (#6780)

Simplify CMake Policies
Per https://github.com/LMMS/lmms/pull/6758#discussion_r1271346366
This commit is contained in:
Tres Finocchiaro
2023-08-02 23:06:18 -04:00
committed by GitHub
parent 2ded48598f
commit bc99728534
4 changed files with 4 additions and 23 deletions

View File

@@ -6,18 +6,7 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR})
SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR})
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0005 NEW)
CMAKE_POLICY(SET CMP0003 NEW)
IF (CMAKE_MAJOR_VERSION GREATER 2)
CMAKE_POLICY(SET CMP0026 NEW)
CMAKE_POLICY(SET CMP0045 NEW)
CMAKE_POLICY(SET CMP0050 OLD)
ENDIF()
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0057 NEW)
ENDIF(COMMAND CMAKE_POLICY)
# CMAKE_POLICY Section
# Import of windows.h breaks min()/max()
ADD_DEFINITIONS(-DNOMINMAX)

View File

@@ -24,7 +24,7 @@ function(DEFINE_INSTALL_VAR)
endif()
else()
if(VAR_GENERATOR_EXPRESSION)
cmake_policy(SET CMP0087 NEW)
cmake_policy(SET CMP0087 NEW) # install(CODE) and install(SCRIPT) support generator expressions.
endif()
install(CODE "set(\"${VAR_NAME}\" \"${VAR_CONTENT}\")")
endif()

View File

@@ -1,8 +1,8 @@
include(GetPrerequisites)
include(CMakeParseArguments)
CMAKE_POLICY(SET CMP0011 NEW)
CMAKE_POLICY(SET CMP0057 NEW)
# Project's cmake_minimum_required doesn't always propagate
cmake_policy(SET CMP0057 NEW) # Support new if() IN_LIST operator.
function(make_absolute var)
get_filename_component(abs "${${var}}" ABSOLUTE BASE_DIR "${CMAKE_INSTALL_PREFIX}")

View File

@@ -1,11 +1,3 @@
# For MacOS, use "OLD" RPATH install_name behavior
# This can be changed to "NEW" safely if install_apple.sh.in
# is updated to relink libcarlabase.dylib. MacOS 10.8 uses
# cmake 3.9.6, so this can be done at any time.
IF(NOT CMAKE_VERSION VERSION_LESS 3.9)
CMAKE_POLICY(SET CMP0068 OLD)
ENDIF()
# If Carla was not provided by the system, make a dummy library instead
if(LMMS_HAVE_WEAKCARLA)
SET(CARLA_INCLUDE_DIRS