Simplify setting of GLFW_STANDALONE CMake variable

Use string(COMPARE EQUAL ...) instead of a whole if() statement.

Related to #2256
This commit is contained in:
Juan Ramos 2023-01-21 11:33:41 -07:00 committed by Camilla Löwy
parent 30b91c8b60
commit 1c9fcdc9df

View File

@ -12,9 +12,7 @@ endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} GLFW_STANDALONE)
set(GLFW_STANDALONE TRUE)
endif()
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE}) option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE})