Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify CMake Policies #6778

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/DefineInstallVar.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions cmake/modules/InstallDependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
include(GetPrerequisites)
include(CMakeParseArguments)

CMAKE_POLICY(SET CMP0011 NEW)
CMAKE_POLICY(SET CMP0057 NEW)

function(make_absolute var)
get_filename_component(abs "${${var}}" ABSOLUTE BASE_DIR "${CMAKE_INSTALL_PREFIX}")
set(${var} ${abs} PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion plugins/CarlaBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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)
CMAKE_POLICY(SET CMP0068 OLD) # RPATH settings on macOS do not affect install_name.
ENDIF()
Comment on lines 5 to 7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now require CMake 3.9, so isn't it possible to either remove the if or switch to the NEW behavior?


# If Carla was not provided by the system, make a dummy library instead
Expand Down