Browse Source

CMake: Remove upgrade code

Follow-up to 75222ccef8
pull/3747/head
Gleb Mazovetskiy 4 years ago
parent
commit
b71814b07b
  1. 10
      3rdParty/SDL_image/CMakeLists.txt
  2. 20
      CMake/Dependencies.cmake
  3. 6
      CMake/functions/dependency_options.cmake

10
3rdParty/SDL_image/CMakeLists.txt vendored

@ -8,16 +8,6 @@ if(NOT DEFINED DEVILUTIONX_SYSTEM_LIBPNG)
message("-- Suitable system png package not found, will use png from source") message("-- Suitable system png package not found, will use png from source")
set(DEVILUTIONX_SYSTEM_LIBPNG OFF) set(DEVILUTIONX_SYSTEM_LIBPNG OFF)
endif() endif()
elseif(DEVILUTIONX_SYSTEM_LIBPNG)
# In previous versions of DevilutionX, libpng could be built from
# source even if `DEVILUTIONX_SYSTEM_LIBPNG` was true.
# Detect the older CMake cache and update to the new behaviour.
#
# This is a temporary upgrade path that will be removed one week from commit date.
find_package(PNG QUIET)
if(NOT PNG_FOUND)
set(DEVILUTIONX_SYSTEM_LIBPNG OFF CACHE BOOL "" FORCE)
endif()
endif() endif()
dependency_options("libpng" DEVILUTIONX_SYSTEM_LIBPNG ON DEVILUTIONX_STATIC_LIBPNG) dependency_options("libpng" DEVILUTIONX_SYSTEM_LIBPNG ON DEVILUTIONX_STATIC_LIBPNG)
if(DEVILUTIONX_SYSTEM_LIBPNG) if(DEVILUTIONX_SYSTEM_LIBPNG)

20
CMake/Dependencies.cmake

@ -60,16 +60,6 @@ if(NOT DEFINED DEVILUTIONX_SYSTEM_SDL_IMAGE)
message("-- Suitable system SDL_image package not found, will use SDL_image from source") message("-- Suitable system SDL_image package not found, will use SDL_image from source")
set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF) set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF)
endif() endif()
elseif(DEVILUTIONX_SYSTEM_SDL_IMAGE)
# In previous versions of DevilutionX, SDL_image could be built from
# source even if `DEVILUTIONX_SYSTEM_SDL_IMAGE` was true.
# Detect the older CMake cache and update to the new behaviour.
#
# This is a temporary upgrade path that will be removed one week from commit date.
_find_SDL_image(QUIET)
if (NOT SDL_image_FOUND)
set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF CACHE BOOL "" FORCE)
endif()
endif() endif()
dependency_options("SDL_image" DEVILUTIONX_SYSTEM_SDL_IMAGE ON DEVILUTIONX_STATIC_SDL_IMAGE) dependency_options("SDL_image" DEVILUTIONX_SYSTEM_SDL_IMAGE ON DEVILUTIONX_STATIC_SDL_IMAGE)
if(DEVILUTIONX_SYSTEM_SDL_IMAGE) if(DEVILUTIONX_SYSTEM_SDL_IMAGE)
@ -105,16 +95,6 @@ if(NOT DEFINED DEVILUTIONX_SYSTEM_LIBFMT)
message("-- Suitable system fmt package not found, will use fmt from source") message("-- Suitable system fmt package not found, will use fmt from source")
set(DEVILUTIONX_SYSTEM_LIBFMT OFF) set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
endif() endif()
elseif(DEVILUTIONX_SYSTEM_LIBFMT)
# In previous versions of DevilutionX, libfmt could be built from
# source even if `DEVILUTIONX_SYSTEM_LIBFMT` was true.
# Detect the older CMake cache and update to the new behaviour.
#
# This is a temporary upgrade path that will be removed one week from commit date.
find_package(fmt 7.0.0 QUIET)
if (NOT fmt_FOUND)
set(DEVILUTIONX_SYSTEM_LIBFMT OFF CACHE BOOL "" FORCE)
endif()
endif() endif()
dependency_options("libfmt" DEVILUTIONX_SYSTEM_LIBFMT ON DEVILUTIONX_STATIC_LIBFMT) dependency_options("libfmt" DEVILUTIONX_SYSTEM_LIBFMT ON DEVILUTIONX_STATIC_LIBFMT)
if(DEVILUTIONX_SYSTEM_LIBFMT) if(DEVILUTIONX_SYSTEM_LIBFMT)

6
CMake/functions/dependency_options.cmake

@ -13,12 +13,6 @@ function(dependency_options LIB_NAME SYSTEM_OPTION_NAME DEFAULT_SYSTEM_VALUE STA
set(_static_default OFF) set(_static_default OFF)
else() else()
set(_static_default ON) set(_static_default ON)
# In previous versions of DevilutionX, the default could be OFF even for non-system libraries.
# Detect the older CMake cache and update to the new behaviour.
#
# This is a temporary upgrade path that will be removed one week from commit date.
set(${STATIC_OPTION_NAME} ON CACHE BOOL "" FORCE)
endif() endif()
option(${STATIC_OPTION_NAME} "Link ${LIB_NAME} statically" ${_static_default}) option(${STATIC_OPTION_NAME} "Link ${LIB_NAME} statically" ${_static_default})
else() else()

Loading…
Cancel
Save