From e53810342a25ac9a418477ebc475ce78e563046d Mon Sep 17 00:00:00 2001 From: Caerind Date: Mon, 19 Aug 2024 18:08:59 +0200 Subject: [PATCH] Make safer CMake --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3dea34..f3ad3eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,15 @@ FetchContent_Declare(SFML GIT_TAG 2.6.x) FetchContent_MakeAvailable(SFML) -add_subdirectory(src) +if(EXISTS src) + add_subdirectory(src) +endif() -add_subdirectory(tests) -add_subdirectory(examples) +if(EXISTS tests) + add_subdirectory(tests) +endif() +if(EXISTS examples) + add_subdirectory(examples) +endif() set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT 3DSceneExample)