From 320218d1819dacf51b84e7d51435eee8d43c0ee2 Mon Sep 17 00:00:00 2001 From: JonnyPtn Date: Tue, 7 Nov 2023 19:05:02 +0000 Subject: [PATCH] Exclude SFML from the ALL build, which stops it being installed alongside the project --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8398e55..edeff90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) include(FetchContent) -FetchContent_Declare(SFML +FetchContent_Declare(sfml GIT_REPOSITORY https://github.com/SFML/SFML.git GIT_TAG 2.6.x) -FetchContent_MakeAvailable(SFML) +if (NOT sfml_POPULATED) + FetchContent_Populate(sfml) + add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR} EXCLUDE_FROM_ALL) +endif() add_executable(CMakeSFMLProject src/main.cpp) target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics)