From e2086fa2dd13a3c9c1f9aa3ecf17e45fbcaea60e Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Mon, 7 Mar 2022 08:20:32 -0500 Subject: [PATCH] Reorganize project files --- CMakeLists.txt | 47 +++++++++++++++++++---------------- app/main.cpp | 4 +-- {lib => src}/camera3d.cpp | 0 {lib => src}/camera3d.h | 0 {lib => src}/input.cpp | 0 {lib => src}/input.h | 0 {lib => src}/mainwidget.cpp | 0 {lib => src}/mainwidget.h | 0 {lib => src}/mesh.cpp | 0 {lib => src}/mesh.h | 0 {lib => src}/meshrenderer.cpp | 0 {lib => src}/meshrenderer.h | 0 {lib => src}/model.cpp | 0 {lib => src}/model.h | 0 {lib => src}/object.cpp | 0 {lib => src}/object.h | 0 {lib => src}/scene.cpp | 0 {lib => src}/scene.h | 0 {lib => src}/skybox.cpp | 0 {lib => src}/skybox.h | 0 {lib => src}/texture.cpp | 0 {lib => src}/texture.h | 0 {lib => src}/transform3D.cpp | 0 {lib => src}/transform3D.h | 0 24 files changed, 28 insertions(+), 23 deletions(-) rename {lib => src}/camera3d.cpp (100%) rename {lib => src}/camera3d.h (100%) rename {lib => src}/input.cpp (100%) rename {lib => src}/input.h (100%) rename {lib => src}/mainwidget.cpp (100%) rename {lib => src}/mainwidget.h (100%) rename {lib => src}/mesh.cpp (100%) rename {lib => src}/mesh.h (100%) rename {lib => src}/meshrenderer.cpp (100%) rename {lib => src}/meshrenderer.h (100%) rename {lib => src}/model.cpp (100%) rename {lib => src}/model.h (100%) rename {lib => src}/object.cpp (100%) rename {lib => src}/object.h (100%) rename {lib => src}/scene.cpp (100%) rename {lib => src}/scene.h (100%) rename {lib => src}/skybox.cpp (100%) rename {lib => src}/skybox.h (100%) rename {lib => src}/texture.cpp (100%) rename {lib => src}/texture.h (100%) rename {lib => src}/transform3D.cpp (100%) rename {lib => src}/transform3D.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e99ae7..593611d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 +) diff --git a/app/main.cpp b/app/main.cpp index 3a96cd7..38e9b78 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -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 ## ##############################################################################*/ diff --git a/lib/camera3d.cpp b/src/camera3d.cpp similarity index 100% rename from lib/camera3d.cpp rename to src/camera3d.cpp diff --git a/lib/camera3d.h b/src/camera3d.h similarity index 100% rename from lib/camera3d.h rename to src/camera3d.h diff --git a/lib/input.cpp b/src/input.cpp similarity index 100% rename from lib/input.cpp rename to src/input.cpp diff --git a/lib/input.h b/src/input.h similarity index 100% rename from lib/input.h rename to src/input.h diff --git a/lib/mainwidget.cpp b/src/mainwidget.cpp similarity index 100% rename from lib/mainwidget.cpp rename to src/mainwidget.cpp diff --git a/lib/mainwidget.h b/src/mainwidget.h similarity index 100% rename from lib/mainwidget.h rename to src/mainwidget.h diff --git a/lib/mesh.cpp b/src/mesh.cpp similarity index 100% rename from lib/mesh.cpp rename to src/mesh.cpp diff --git a/lib/mesh.h b/src/mesh.h similarity index 100% rename from lib/mesh.h rename to src/mesh.h diff --git a/lib/meshrenderer.cpp b/src/meshrenderer.cpp similarity index 100% rename from lib/meshrenderer.cpp rename to src/meshrenderer.cpp diff --git a/lib/meshrenderer.h b/src/meshrenderer.h similarity index 100% rename from lib/meshrenderer.h rename to src/meshrenderer.h diff --git a/lib/model.cpp b/src/model.cpp similarity index 100% rename from lib/model.cpp rename to src/model.cpp diff --git a/lib/model.h b/src/model.h similarity index 100% rename from lib/model.h rename to src/model.h diff --git a/lib/object.cpp b/src/object.cpp similarity index 100% rename from lib/object.cpp rename to src/object.cpp diff --git a/lib/object.h b/src/object.h similarity index 100% rename from lib/object.h rename to src/object.h diff --git a/lib/scene.cpp b/src/scene.cpp similarity index 100% rename from lib/scene.cpp rename to src/scene.cpp diff --git a/lib/scene.h b/src/scene.h similarity index 100% rename from lib/scene.h rename to src/scene.h diff --git a/lib/skybox.cpp b/src/skybox.cpp similarity index 100% rename from lib/skybox.cpp rename to src/skybox.cpp diff --git a/lib/skybox.h b/src/skybox.h similarity index 100% rename from lib/skybox.h rename to src/skybox.h diff --git a/lib/texture.cpp b/src/texture.cpp similarity index 100% rename from lib/texture.cpp rename to src/texture.cpp diff --git a/lib/texture.h b/src/texture.h similarity index 100% rename from lib/texture.h rename to src/texture.h diff --git a/lib/transform3D.cpp b/src/transform3D.cpp similarity index 100% rename from lib/transform3D.cpp rename to src/transform3D.cpp diff --git a/lib/transform3D.h b/src/transform3D.h similarity index 100% rename from lib/transform3D.h rename to src/transform3D.h