From 75c0fa25c02daa72b72dda2f021db89975e95f67 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 21 Feb 2022 08:48:20 -0500 Subject: [PATCH] Fix bullet's cmake_minimum_version warning --- extern/CMakeLists.txt | 18 ++++++++++++++---- extern/fix_bullet_cmake_version.patch | 1 - 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 97d14d3..ac73e8a 100755 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -1,24 +1,32 @@ set(CMAKE_FOLDER "External") include(FetchContent) +# cmake does not feel like fixing this terrible issue in fetchcontent, so we are going to fix it ourselves. +# solution located here: https://gitlab.kitware.com/cmake/cmake/-/issues/21146#note_933303 +if(NOT WINDOWS) + set(BULLET_PATCH_COMMAND git apply -v --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/fix_bullet_cmake_version.patch || true) +endif() + FetchContent_Declare( bullet GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git - GIT_TAG 2.89 - CMAKE_ARGS "-Wno-dev" - PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/fix_bullet_cmake_version.patch + GIT_TAG fa50f195e6911d60c5ed888d5df33adb1736f93b # v3.21 + PATCH_COMMAND ${BULLET_PATCH_COMMAND} + GIT_SHALLOW ON ) FetchContent_Declare( spirv-cross GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Cross.git GIT_TAG MoltenVK-1.1.5 + GIT_PROGRESS TRUE ) FetchContent_Declare( glslang GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git GIT_TAG df609a01b386001e367709086c58529c48028d1e # taken from https://github.com/KhronosGroup/SPIRV-Cross/blob/2021-01-15/checkout_glslang_spirv_tools.sh#L3 + GIT_PROGRESS TRUE ) # bullet @@ -66,7 +74,8 @@ add_subdirectory(doctest) FetchContent_Declare(json GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git - GIT_TAG v3.9.1) + GIT_TAG v3.9.1 + GIT_PROGRESS TRUE) FetchContent_GetProperties(json) if (NOT json_POPULATED) @@ -109,6 +118,7 @@ FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt GIT_TAG 8.0.1 + GIT_PROGRESS TRUE ) FetchContent_MakeAvailable(fmt) diff --git a/extern/fix_bullet_cmake_version.patch b/extern/fix_bullet_cmake_version.patch index 450de89..c880d78 100644 --- a/extern/fix_bullet_cmake_version.patch +++ b/extern/fix_bullet_cmake_version.patch @@ -1,5 +1,4 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 68e0a93bc..5b83fb1cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@