From 17f91cbc7e7bdf7e259939be2f33272364ff1ebe Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 2 Jun 2025 16:36:05 +0200 Subject: [PATCH] [glfw] Clean up CMakeLists.txt, disable glbindings/glfw examples --- spine-glfw/CMakeLists.txt | 73 +++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/spine-glfw/CMakeLists.txt b/spine-glfw/CMakeLists.txt index 8ff02a105..8dea5902e 100644 --- a/spine-glfw/CMakeLists.txt +++ b/spine-glfw/CMakeLists.txt @@ -2,7 +2,15 @@ cmake_minimum_required(VERSION 3.10) project(spine-glfw) include(FetchContent) -# Fetch GLFW + +# Suppress dependency targets from appearing in IDE +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + +# Fetch GLFW with minimal targets +set(GLFW_BUILD_EXAMPLES OFF) +set(GLFW_BUILD_TESTS OFF) +set(GLFW_BUILD_DOCS OFF) +set(GLFW_INSTALL OFF) FetchContent_Declare( glfw GIT_REPOSITORY https://github.com/glfw/glfw.git @@ -10,12 +18,12 @@ FetchContent_Declare( GIT_SHALLOW 1 ) FetchContent_MakeAvailable(glfw) -set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) -set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE) -set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE) -set(GLFW_INSTALL OFF CACHE BOOL " " FORCE) -# Fetch glbinding +# Fetch glbinding with minimal targets +set(OPTION_BUILD_DOCS OFF) +set(OPTION_BUILD_EXAMPLES OFF) +set(OPTION_BUILD_TEST OFF) +set(OPTION_BUILD_TOOLS OFF) FetchContent_Declare( glbinding GIT_REPOSITORY https://github.com/cginternals/glbinding.git @@ -23,10 +31,55 @@ FetchContent_Declare( GIT_SHALLOW 1 ) FetchContent_MakeAvailable(glbinding) -set(OPTION_BUILD_DOCS OFF CACHE BOOL " " FORCE) -set(OPTION_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) -set(OPTION_BUILD_TEST OFF CACHE BOOL " " FORCE) -set(OPTION_BUILD_TOOLS OFF CACHE BOOL " " FORCE) + +# Organize dependency targets into folders for cleaner IDE view +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_target_properties(glfw PROPERTIES FOLDER "Dependencies") +set_target_properties(glbinding PROPERTIES FOLDER "Dependencies") +set_target_properties(glbinding-aux PROPERTIES FOLDER "Dependencies") +if(TARGET glbinding-glmeta) + set_target_properties(glbinding-glmeta PROPERTIES FOLDER "Dependencies") +endif() +if(TARGET KHRplatform-sources) + set_target_properties(KHRplatform-sources PROPERTIES FOLDER "Dependencies") +endif() +if(TARGET cubescape-sdl-gl) + set_target_properties(cubescape-sdl-gl PROPERTIES FOLDER "Dependencies/glbinding-examples") +endif() +if(TARGET cubescape-sdl-gles) + set_target_properties(cubescape-sdl-gles PROPERTIES FOLDER "Dependencies/glbinding-examples") +endif() +if(TARGET cubescape-shared-gl) + set_target_properties(cubescape-shared-gl PROPERTIES FOLDER "Dependencies/glbinding-examples") +endif() +if(TARGET cubescape-shared-gles) + set_target_properties(cubescape-shared-gles PROPERTIES FOLDER "Dependencies/glbinding-examples") +endif() +# Organize cmake utility targets +if(TARGET uninstall) + set_target_properties(uninstall PROPERTIES FOLDER "CMake") +endif() +if(TARGET update_mappings) + set_target_properties(update_mappings PROPERTIES FOLDER "CMake") +endif() +if(TARGET pack) + set_target_properties(pack PROPERTIES FOLDER "CMake") +endif() +if(TARGET pack-glbinding) + set_target_properties(pack-glbinding PROPERTIES FOLDER "CMake") +endif() +if(TARGET install) + set_target_properties(install PROPERTIES FOLDER "CMake") +endif() +if(TARGET component_install) + set_target_properties(component_install PROPERTIES FOLDER "CMake") +endif() +if(TARGET ALL_BUILD) + set_target_properties(ALL_BUILD PROPERTIES FOLDER "CMake") +endif() +if(TARGET ZERO_CHECK) + set_target_properties(ZERO_CHECK PROPERTIES FOLDER "CMake") +endif() include_directories(${glbinding_SOURCE_DIR}/include) include_directories(src)