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 # Mainwidget
add_library(main-widget lib/mainwidget.cpp) add_library(main-widget src/mainwidget.cpp src/mainwidget.h)
target_include_directories(main-widget PUBLIC lib/) target_include_directories(main-widget PUBLIC src/)
target_include_directories(main-widget PRIVATE ${OPENGL_INCLUDE_DIR}) target_include_directories(main-widget PRIVATE ${OPENGL_INCLUDE_DIR})
target_link_libraries(main-widget PRIVATE ${OPENGL_LIBRARIES}) target_link_libraries(main-widget PRIVATE ${OPENGL_LIBRARIES})
# Input # Input
add_library(input lib/input.cpp) add_library(input src/input.cpp src/input.h)
target_include_directories(input PUBLIC lib/) target_include_directories(input PUBLIC src/)
target_link_libraries(input PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(input PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Mesh # Mesh
add_library(mesh lib/mesh.cpp) add_library(mesh src/mesh.cpp src/mesh.h)
target_include_directories(mesh PUBLIC lib/) target_include_directories(mesh PUBLIC src/)
target_link_libraries(mesh PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) target_link_libraries(mesh PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Texture # Texture
add_library(texture lib/texture.cpp) add_library(texture src/texture.cpp src/texture.h)
target_include_directories(texture PUBLIC lib/) target_include_directories(texture PUBLIC src/)
target_link_libraries(texture PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) target_link_libraries(texture PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Object # Object
add_library(object lib/object.cpp) add_library(object src/object.cpp src/object.h)
target_include_directories(object PUBLIC lib/) target_include_directories(object PUBLIC src/)
target_link_libraries(object INTERFACE mesh) 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}::OpenGL)
target_link_libraries(object PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) target_link_libraries(object PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# MeshRenderer # MeshRenderer
add_library(meshrenderer lib/meshrenderer.cpp) add_library(meshrenderer src/meshrenderer.cpp src/meshrenderer.h)
target_include_directories(meshrenderer PUBLIC lib/) target_include_directories(meshrenderer PUBLIC src/)
target_link_libraries(meshrenderer PUBLIC object) target_link_libraries(meshrenderer PUBLIC object)
# Camera3D # Camera3D
add_library(camera3d lib/camera3d.cpp) add_library(camera3d src/camera3d.cpp src/camera3d.h)
target_include_directories(camera3d PUBLIC lib/) target_include_directories(camera3d PUBLIC src/)
target_link_libraries(camera3d INTERFACE input) target_link_libraries(camera3d INTERFACE input)
target_link_libraries(camera3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(camera3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Skybox # Skybox
add_library(skybox lib/skybox.cpp) add_library(skybox src/skybox.cpp src/skybox.h)
# Skybox needs Mesh, Camera3D, and Qt6::Widgets # Skybox needs Mesh, Camera3D, and Qt6::Widgets
target_link_libraries(skybox PRIVATE mesh) target_link_libraries(skybox PRIVATE mesh)
target_link_libraries(skybox PRIVATE camera3d) target_link_libraries(skybox PRIVATE camera3d)
target_link_libraries(skybox PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) target_link_libraries(skybox PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Transform3D # Transform3D
add_library(transform3d lib/transform3D.cpp) add_library(transform3d src/transform3D.cpp src/transform3D.h)
target_include_directories(transform3d PUBLIC lib/) target_include_directories(transform3d PUBLIC src/)
target_link_libraries(transform3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(transform3d PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
# Model # Model
add_library(model lib/model.cpp) add_library(model src/model.cpp src/model.h)
target_include_directories(model PUBLIC lib/) target_include_directories(model PUBLIC src/)
target_link_libraries(model PRIVATE assimp) target_link_libraries(model PRIVATE assimp)
target_link_libraries(model PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL) target_link_libraries(model PUBLIC Qt${QT_VERSION_MAJOR}::OpenGL)
# Model library requires transform3d and Qt6::Widgets # 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) target_link_libraries(model PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets)
# Scene # Scene
add_library(scene lib/scene.cpp) add_library(scene src/scene.cpp src/scene.h)
target_include_directories(scene PUBLIC lib/) target_include_directories(scene PUBLIC src/)
target_link_libraries(scene PUBLIC model) target_link_libraries(scene PUBLIC model)
target_link_libraries(scene PUBLIC meshrenderer) target_link_libraries(scene PUBLIC meshrenderer)
target_link_libraries(scene PUBLIC skybox) 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 # Link qtk executable to main main-widget library
target_link_libraries(qtk PUBLIC main-widget) 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 ## ## Author: Shaun Reed ##
## Legal: All Content (c) 2021 Shaun Reed, all rights reserved ## ## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
## About: Main program for practice using Qt5 widgets and OpenGL ## ## About: Main program for practice using Qt6 widgets and OpenGL ##
## ## ## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ## ## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
##############################################################################*/ ##############################################################################*/