Reorganize project files

This commit is contained in:
Shaun Reed 2022-03-07 08:20:32 -05:00
parent 22d6ac1b06
commit e2086fa2dd
24 changed files with 28 additions and 23 deletions

View File

@ -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)
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)
# 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
)

View File

@ -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 ##
##############################################################################*/