Skip to content

Commit

Permalink
Remove glTF-Sample-Models submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Sep 15, 2022
1 parent 7088007 commit 0b279a5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ simdjson/

# Test files
tests/gltf/intel_sponza/
tests/gltf/sample-models/
tests/gltf_loaders/
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "tests/gltf/sample-models"]
path = tests/gltf/sample-models
url = https://github.com/KhronosGroup/glTF-Sample-Models/
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.24)
project(fastgltf)

cmake_policy(SET CMP0135 NEW)

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/add_source_directory.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compiler_flags.cmake)
include(ExternalProject)
include(FetchContent)

# Download and configure simdjson
Expand All @@ -11,8 +14,10 @@ set(SIMDJSON_HEADER_FILE "${CMAKE_CURRENT_SOURCE_DIR}/simdjson/simdjson.h")
set(SIMDJSON_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/simdjson/simdjson.cpp")

macro(download_simdjson)
file(DOWNLOAD "https://github.com/simdjson/simdjson/releases/download/v${SIMDJSON_TARGET_VERSION}/simdjson.h" ${SIMDJSON_HEADER_FILE})
file(DOWNLOAD "https://github.com/simdjson/simdjson/releases/download/v${SIMDJSON_TARGET_VERSION}/simdjson.cpp" ${SIMDJSON_SOURCE_FILE})
file(DOWNLOAD "https://github.com/simdjson/simdjson/releases/download/v${SIMDJSON_TARGET_VERSION}/simdjson.h" ${SIMDJSON_HEADER_FILE}
SHOW_PROGRESS)
file(DOWNLOAD "https://github.com/simdjson/simdjson/releases/download/v${SIMDJSON_TARGET_VERSION}/simdjson.cpp" ${SIMDJSON_SOURCE_FILE}
SHOW_PROGRESS)
endmacro()

if (EXISTS ${SIMDJSON_HEADER_FILE})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ By utilising simdjson, this library can take advantage of SSE4, AVX2, AVX512, an

## Usage

The project uses a fairly simple CMake 3.10 script, which you can simply add as a subdirectory.
The project uses a fairly simple CMake 3.24 script, which you can simply add as a subdirectory.

```cpp
#include <fastgltf_parser.hpp>
Expand Down
16 changes: 15 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.1.0)
FetchContent_MakeAvailable(Catch2)
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL TRUE)

message(STATUS "Downloading glTF Sample Models")
ExternalProject_Add(gltf-sample-models
URL "https://github.com/KhronosGroup/glTF-Sample-Models/archive/8e9a5a6ad1a2790e2333e3eb48a1ee39f9e0e31b.zip"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gltf/sample-models"
DOWNLOAD_EXTRACT_TIMESTAMP false
DOWNLOAD_NO_PROGRESS FALSE
EXCLUDE_FROM_ALL
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")

# We want these tests to be a optional executable.
add_executable(tests EXCLUDE_FROM_ALL)
Expand All @@ -12,4 +24,6 @@ target_link_libraries(tests PRIVATE fastgltf)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
compiler_flags(TARGET tests)

add_dependencies(tests gltf-sample-models)

add_source_directory(TARGET tests FOLDER ".")
1 change: 0 additions & 1 deletion tests/gltf/sample-models
Submodule sample-models deleted from 16e803

0 comments on commit 0b279a5

Please sign in to comment.