Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puts All 3rd Parties Dependencies In One Folder #9

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (UNIX OR APPLE)
set(CMAKE_ERROR_DEPRECATED OFF)
endif ()

add_subdirectory(third-party)
add_subdirectory(Extractor)
add_subdirectory(ModelConverter)

Expand Down
8 changes: 4 additions & 4 deletions Extractor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include_directories(../argparse)
include_directories(../json)
include_directories(../third-party/argparse)
include_directories(../third-party/json)

add_executable(Extractor
extractor.h
extractor.cpp

../argparse/argparse.hpp
../json/json.hpp
../third-party/argparse/argparse.hpp
../third-party/json/json.hpp
Utility.h
Utility.cpp
Regions.h
Expand Down
31 changes: 16 additions & 15 deletions ModelConverter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(assimp)

add_subdirectory(third-party)

include_directories(./)
include_directories(../third-party/stb)

add_executable(ModelConverter
main.cpp
game/sgd.h
game/sgd.cpp
game/sgd_types.h

render/tim2.cpp
render/tim2.h
utils/logging.cpp
utils/logging.h
render/sgdMdl.cpp
render/sgdMdl.h
render/tim2.cpp
render/tim2.h

game/vif.h
game/vif.cpp
game/Mesh.cpp
Expand All @@ -27,18 +19,27 @@ add_executable(ModelConverter
game/Texture.cpp
game/packfile.h
game/packfile.cpp
stb_write_image.h
game/Model.cpp
game/Model.h
math/linalg.cpp
math/linalg.h
utils/utility.cpp
utils/utility.h
game/sgd.h
game/sgd.cpp
game/sgd_types.h
game/Exporter.cpp
game/Exporter.h
game/gra3dSGDData.cpp
game/gra3dSGDData.h

utils/utility.cpp
utils/utility.h
utils/logging.cpp
utils/logging.h
utils/assimp_utils.cpp
utils/assimp_utils.h
game/gra3dSGDData.cpp game/gra3dSGDData.h)

../third-party/stb/stb_write_image.h
)

target_link_libraries(ModelConverter PRIVATE spdlog assimp)

Expand Down
9 changes: 4 additions & 5 deletions ModelConverter/math/linalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ Vector3 &operator+=(Vector3 &source, const Vector3 &target) {
}

Vector3& operator+(Vector3 &source, Vector3 &target) {
Vector3 result = {0};
result.x = source.x + target.x;
result.y = source.y + target.y;
result.z = source.z + target.z;
source.x = source.x + target.x;
source.y = source.y + target.y;
source.z = source.z + target.z;

return result;
return source;
}

Vector3 &operator+=(Vector3 &source, const Vector4 *target) {
Expand Down
15 changes: 0 additions & 15 deletions ModelConverter/third-party/CMakeLists.txt

This file was deleted.

5 changes: 5 additions & 0 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Setup SPDLOG
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(assimp)

add_subdirectory(spdlog)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT OFF CACHE BOOL "Disable all exporters"
set(ASSIMP_BUILD_OBJ_EXPORTER OFF CACHE BOOL "Enable OBJ exporter" FORCE)
set(ASSIMP_BUILD_COLLADA_EXPORTER OFF CACHE BOOL "Enable COLLADA exporter" FORCE)
set(ASSIMP_BUILD_FBX_EXPORTER OFF CACHE BOOL "Enable FBX exporter" FORCE)
set(ASSIMP_BUILD_ASSIMP_VIEW OFF CACHE BOOL "Disable assimp view" FORCE)

# Enable GLTF importer and exporter, if importer is nor included then exporter build will fail
set(ASSIMP_BUILD_GLTF_EXPORTER ON CACHE BOOL "Enable GLTF exporter" FORCE)
set(ASSIMP_BUILD_GLTF_IMPORTER ON CACHE BOOL "Enable GLTF importer" FORCE)
set(ASSIMP_BUILD_ASSIMP_VIEW OFF CACHE BOOL "Disable assimp view" FORCE)

FetchContent_Declare(
assimp
GIT_REPOSITORY https://github.com/assimp/assimp.git
GIT_TAG v5.3.1
)

FetchContent_MakeAvailable(assimp)
FetchContent_MakeAvailable(assimp)
File renamed without changes.
File renamed without changes.
Loading