From db972f86357d3d2d94feb2acdd18f41643c09d9a Mon Sep 17 00:00:00 2001 From: Andrii Solianyk Date: Sat, 8 Feb 2025 12:26:36 +0100 Subject: [PATCH] CMakeLists fix for Mac on Apple Silicon processors --- CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9348163..c7b7b52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.25) project(LotoStatek) - +include(FetchContent) set(CMAKE_CXX_STANDARD 17) add_executable(LotoStatek main.cpp @@ -63,9 +63,12 @@ if(WIN32) target_link_libraries(LotoStatek ${SFML_LIBRARIES}) endif() elseif(APPLE) - find_package(SFML 2.6.2 COMPONENTS graphics window system REQUIRED) - target_link_libraries(LotoStatek sfml-graphics sfml-window sfml-audio sfml-system) -elseif(LINUX) - find_package(SFML 2.6.2 COMPONENTS graphics window system REQUIRED) + set(BUILD_SHARED_LIBS OFF) + FetchContent_Declare( + SFML + GIT_REPOSITORY https://github.com/SFML/SFML.git + GIT_TAG 2.6.2 + ) + FetchContent_MakeAvailable(SFML) target_link_libraries(LotoStatek sfml-graphics sfml-window sfml-audio sfml-system) endif() \ No newline at end of file