From ed935e50cd0f7f304d743d0c6c21c6332888f250 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 16 Sep 2022 12:46:44 +0200 Subject: [PATCH] CMake: Automatically build examples during standalone compilation --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d490e..b894234 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,13 @@ # Set engine name set(ENGINE "inferno") +if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + set(INFERNO_STANDALONE TRUE) +endif() + # Options option(BUILD_SHARED_LIBS "Build shared libraries" OFF) -option(INFERNO_BUILD_EXAMPLES "Build the Inferno example programs" OFF) +option(INFERNO_BUILD_EXAMPLES "Build the Inferno example programs" ${INFERNO_STANDALONE}) # ------------------------------------------