From 1c9fcdc9df3c479cc7adab369df20e10ea179418 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Sat, 21 Jan 2023 11:33:41 -0700 Subject: [PATCH] Simplify setting of GLFW_STANDALONE CMake variable Use string(COMPARE EQUAL ...) instead of a whole if() statement. Related to #2256 --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22e71864..dd256a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,7 @@ endif() set_property(GLOBAL PROPERTY USE_FOLDERS ON) -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - set(GLFW_STANDALONE TRUE) -endif() +string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} GLFW_STANDALONE) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE})