Browse Source

Reorganize project files

master
Shaun Reed 4 months ago
parent
commit
e2086fa2dd
  1. 47
      CMakeLists.txt
  2. 4
      app/main.cpp
  3. 0
      src/camera3d.cpp
  4. 0
      src/camera3d.h
  5. 0
      src/input.cpp
  6. 0
      src/input.h
  7. 0
      src/mainwidget.cpp
  8. 0
      src/mainwidget.h
  9. 0
      src/mesh.cpp
  10. 0
      src/mesh.h
  11. 0
      src/meshrenderer.cpp
  12. 0
      src/meshrenderer.h
  13. 0
      src/model.cpp
  14. 0
      src/model.h
  15. 0
      src/object.cpp
  16. 0
      src/object.h
  17. 0
      src/scene.cpp
  18. 0
      src/scene.h
  19. 0
      src/skybox.cpp
  20. 0
      src/skybox.h
  21. 0
      src/texture.cpp
  22. 0
      src/texture.h
  23. 0
      src/transform3D.cpp
  24. 0
      src/transform3D.h

47
CMakeLists.txt

@ -48,59 +48,59 @@ find_package(assimp REQUIRED) @@ -48,59 +48,59 @@ find_package(assimp REQUIRED)
################################################################################
# Mainwidget
add_library(main-widget lib/mainwidget.cpp)
target_include_directories(main-widget PUBLIC lib/)
add_library(main-widget src/mainwidget.cpp src/mainwidget.h)
target_include_directories(main-widget PUBLIC src/)
target_include_directories(main-widget PRIVATE ${OPENGL_INCLUDE_DIR})
target_link_libraries(main-widget PRIVATE ${OPENGL_LIBRARIES})
# Input
add_library(input lib/input.cpp)
target_include_directories(input PUBLIC lib/)
add_library(input src/input.cpp src/input.h)
target_include_directories(input PUBLIC src/)
target_link_libraries(input PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Mesh
add_library(mesh lib/mesh.cpp)
target_include_directories(mesh PUBLIC lib/)
add_library(mesh src/mesh.cpp src/mesh.h)
target_include_directories(mesh PUBLIC src/)
target_link_libraries(mesh PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Texture
add_library(texture lib/texture.cpp)
target_include_directories(texture PUBLIC lib/)
add_library(texture src/texture.cpp src/texture.h)
target_include_directories(texture PUBLIC src/)
target_link_libraries(texture PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Object
add_library(object lib/object.cpp)
target_include_directories(object PUBLIC lib/)
add_library(object src/object.cpp src/object.h)
target_include_directories(object PUBLIC src/)
target_link_libraries(object INTERFACE mesh)
target_link_libraries(object PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL)
target_link_libraries(object PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# MeshRenderer
add_library(meshrenderer lib/meshrenderer.cpp)
target_include_directories(meshrenderer PUBLIC lib/)
add_library(meshrenderer src/meshrenderer.cpp src/meshrenderer.h)
target_include_directories(meshrenderer PUBLIC src/)
target_link_libraries(meshrenderer PUBLIC object)
# Camera3D
add_library(camera3d lib/camera3d.cpp)
target_include_directories(camera3d PUBLIC lib/)
add_library(camera3d src/camera3d.cpp src/camera3d.h)
target_include_directories(camera3d PUBLIC src/)
target_link_libraries(camera3d INTERFACE input)
target_link_libraries(camera3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Skybox
add_library(skybox lib/skybox.cpp)
add_library(skybox src/skybox.cpp src/skybox.h)
# Skybox needs Mesh, Camera3D, and Qt6::Widgets
target_link_libraries(skybox PRIVATE mesh)
target_link_libraries(skybox PRIVATE camera3d)
target_link_libraries(skybox PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Transform3D
add_library(transform3d lib/transform3D.cpp)
target_include_directories(transform3d PUBLIC lib/)
add_library(transform3d src/transform3D.cpp src/transform3D.h)
target_include_directories(transform3d PUBLIC src/)
target_link_libraries(transform3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Model
add_library(model lib/model.cpp)
target_include_directories(model PUBLIC lib/)
add_library(model src/model.cpp src/model.h)
target_include_directories(model PUBLIC src/)
target_link_libraries(model PRIVATE assimp)
target_link_libraries(model PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL)
# Model library requires transform3d and Qt6::Widgets
@ -108,8 +108,8 @@ target_link_libraries(model PUBLIC transform3d) @@ -108,8 +108,8 @@ target_link_libraries(model PUBLIC transform3d)
target_link_libraries(model PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Scene
add_library(scene lib/scene.cpp)
target_include_directories(scene PUBLIC lib/)
add_library(scene src/scene.cpp src/scene.h)
target_include_directories(scene PUBLIC src/)
target_link_libraries(scene PUBLIC model)
target_link_libraries(scene PUBLIC meshrenderer)
target_link_libraries(scene PUBLIC skybox)
@ -126,3 +126,8 @@ target_link_libraries(main-widget PUBLIC scene) @@ -126,3 +126,8 @@ target_link_libraries(main-widget PUBLIC scene)
# Link qtk executable to main main-widget library
target_link_libraries(qtk PUBLIC main-widget)
set_target_properties(qtk PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)

4
app/main.cpp

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
/*##############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ##
## About: Main program for practice using Qt5 widgets and OpenGL ##
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## About: Main program for practice using Qt6 widgets and OpenGL ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################*/

0
lib/camera3d.cpp → src/camera3d.cpp

0
lib/camera3d.h → src/camera3d.h

0
lib/input.cpp → src/input.cpp

0
lib/input.h → src/input.h

0
lib/mainwidget.cpp → src/mainwidget.cpp

0
lib/mainwidget.h → src/mainwidget.h

0
lib/mesh.cpp → src/mesh.cpp

0
lib/mesh.h → src/mesh.h

0
lib/meshrenderer.cpp → src/meshrenderer.cpp

0
lib/meshrenderer.h → src/meshrenderer.h

0
lib/model.cpp → src/model.cpp

0
lib/model.h → src/model.h

0
lib/object.cpp → src/object.cpp

0
lib/object.h → src/object.h

0
lib/scene.cpp → src/scene.cpp

0
lib/scene.h → src/scene.h

0
lib/skybox.cpp → src/skybox.cpp

0
lib/skybox.h → src/skybox.h

0
lib/texture.cpp → src/texture.cpp

0
lib/texture.h → src/texture.h

0
lib/transform3D.cpp → src/transform3D.cpp

0
lib/transform3D.h → src/transform3D.h

Loading…
Cancel
Save