From 4ebb90c774cacacd89e24886e4bef595c5ca9e10 Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Sun, 1 Dec 2024 09:16:01 +0000 Subject: [PATCH] cmake: hot fixes (#1638) --- CMakeLists.txt | 5 +++-- externals/CMakeLists.txt | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac1a602..82b85f2d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -cmake_minimum_required(VERSION 3.16.3) +# Version 3.24 needed for FetchContent OVERRIDE_FIND_PACKAGE +cmake_minimum_required(VERSION 3.24) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -110,7 +111,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_ find_package(Boost 1.84.0 CONFIG) find_package(FFmpeg 5.1.2 MODULE) find_package(fmt 10.2.0 CONFIG) -find_package(glslang 14.2.0 CONFIG) +find_package(glslang 15 CONFIG) find_package(half 1.12.0 MODULE) find_package(magic_enum 0.9.6 CONFIG) find_package(PNG 1.6 MODULE) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 53802276..50eda028 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -38,7 +38,8 @@ else() set(CRYPTOPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/) add_subdirectory(cryptopp-cmake) file(COPY cryptopp DESTINATION cryptopp FILES_MATCHING PATTERN "*.h") - target_include_directories(cryptopp INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/cryptopp") + # remove externals/cryptopp from include directories because it contains a conflicting zlib.h file + set_target_properties(cryptopp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/cryptopp") endif() endif() @@ -67,6 +68,8 @@ if (NOT TARGET ZLIB::ZLIB) ) FetchContent_MakeAvailable(ZLIB) add_library(ZLIB::ZLIB ALIAS zlib) + # libpng expects this variable to exist after its find_package(ZLIB) + get_target_property(ZLIB_INCLUDE_DIRS zlib INTERFACE_INCLUDE_DIRECTORIES) endif() # SDL3