Skip to content

Commit 1c3b16f

Browse files
Header Re-Organization for Consistency and Readability
- Provide a consistent taxonomy for headers, where the libraries(ZEngine and Tetragrama) expose their Interface(the -I flag) as the root of the package and header naming is synchronized with namespaces - This is especially important in libraries like Tetragrama where you have headers from ZEngine and Tetragrama in the same header file - Make the CMake files cleaner and more consistent by having a uniform naming convention for the Targets
1 parent 3f78f0c commit 1c3b16f

File tree

226 files changed

+759
-950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+759
-950
lines changed

Obelisk/CMakeLists.txt

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,36 @@ project (Obelisk
99
set (CMAKE_CXX_STANDARD_REQUIRED ON)
1010
set (CMAKE_CXX_STANDARD 20)
1111

12-
set (TARGET_NAME Obelisk)
13-
1412
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
15-
add_executable (${TARGET_NAME} WIN32)
13+
add_executable (Obelisk WIN32)
1614
else()
17-
add_executable (${TARGET_NAME})
15+
add_executable (Obelisk)
1816
endif()
1917

20-
target_sources(${TARGET_NAME} PUBLIC EntryPoint.cpp)
18+
target_sources(Obelisk PRIVATE EntryPoint.cpp)
2119

2220
# We set this debugger directory to find assets and resources file
2321
# after being copied to Debug and Release output directories
2422
#
2523
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
26-
set_target_properties(${TARGET_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
24+
set_target_properties(Obelisk PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
2725
endif ()
2826

29-
target_include_directories (${TARGET_NAME}
30-
PRIVATE
31-
.
32-
${ENLISTMENT_ROOT}
33-
${ENLISTMENT_ROOT}/ZEngine
34-
)
35-
36-
target_precompile_headers(${TARGET_NAME} PRIVATE pch.h)
37-
38-
target_compile_definitions(${TARGET_NAME}
27+
target_compile_definitions(Obelisk
3928
PRIVATE
4029
NOMINMAX
4130
UNICODE
4231
_UNICODE
4332
)
4433

45-
target_link_libraries(${TARGET_NAME} PUBLIC
46-
tetragrama
34+
target_link_libraries(Obelisk PUBLIC
35+
Tetragrama
4736
imported::External_obeliskLibs
4837
)
4938

50-
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
39+
set_target_properties(Obelisk PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
5140

52-
install(TARGETS ${TARGET_NAME}
41+
install(TARGETS Obelisk
5342
DESTINATION bin
5443
)
5544

Obelisk/EntryPoint.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#include <CLI/CLI.hpp>
2+
#include <Tetragrama/Editor.h>
3+
#include <ZEngine/Applications/GameApplication.h>
24
#include <ZEngine/Core/Memory/MemoryManager.h>
35
#include <ZEngine/EngineConfiguration.h>
46
#include <ZEngine/Logging/Logger.h>
5-
#include <ZEngine/Applications/GameApplication.h>
6-
7-
#include <Tetragrama/Editor.h>
87

98
#ifdef ZENGINE_PLATFORM
109

@@ -23,11 +22,9 @@ int applicationEntryPoint(int argc, char* argv[])
2322
LoggerConfiguration logger_cfg = {};
2423
Logger::Initialize(arena, logger_cfg);
2524

26-
2725
GameApplicationPtr app = nullptr;
2826

29-
30-
CLI::App cli{"ObeliskCLI"};
27+
CLI::App cli{"ObeliskCLI"};
3128
argv = cli.ensure_utf8(argv);
3229

3330
std::string config_file = "";
@@ -37,10 +34,9 @@ int applicationEntryPoint(int argc, char* argv[])
3734

3835
CLI11_PARSE(cli, argc, argv);
3936

40-
4137
if (launch_editor)
4238
{
43-
app = ZPushStructCtor(arena, Tetragrama::Editor);
39+
app = ZPushStructCtor(arena, Tetragrama::Editor);
4440
app->EnableRenderOverlay = true;
4541
}
4642

Obelisk/pch.h

Lines changed: 0 additions & 18 deletions
This file was deleted.

Tetragrama/CMakeLists.txt

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,25 @@ file (GLOB_RECURSE CPP_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
1414

1515
source_group (TREE ${PROJECT_SOURCE_DIR} PREFIX "Source Files" FILES ${HEADER_FILES} ${CPP_FILES})
1616

17-
set (TARGET_NAME tetragrama)
17+
add_library (Tetragrama)
1818

19-
add_library (${TARGET_NAME})
20-
21-
target_sources(${TARGET_NAME} PUBLIC ${HEADER_FILES} ${CPP_FILES})
19+
target_sources(Tetragrama
20+
PUBLIC FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/..
21+
PRIVATE ${CPP_FILES}
22+
)
2223

2324
# We set this debugger directory to find assets and resources file
2425
# after being copied to Debug and Release output directories
2526
#
2627
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
27-
set_target_properties(${TARGET_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
28+
set_target_properties(Tetragrama PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
2829
endif ()
2930

30-
target_include_directories (${TARGET_NAME}
31-
PUBLIC
32-
.
33-
./Components
34-
./Components/Events
35-
./Controllers
36-
./Inputs
37-
./Layers
38-
./Messengers
39-
./Helpers
40-
./Importers
41-
./Serializers
42-
./Managers
43-
)
44-
45-
target_precompile_headers(${TARGET_NAME} PRIVATE pch.h)
46-
47-
target_compile_definitions(${TARGET_NAME}
31+
target_compile_definitions(Tetragrama
4832
PRIVATE
4933
NOMINMAX
5034
UNICODE
5135
_UNICODE
5236
)
5337

54-
target_link_libraries(${TARGET_NAME} PUBLIC zEngineLib)
38+
target_link_libraries(Tetragrama PUBLIC zEngineLib)

Tetragrama/Components/AboutUIComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
33
#include <imgui.h>
44

55
namespace Tetragrama::Components

Tetragrama/Components/DemoUIComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
33
#include <imgui.h>
44

55
namespace Tetragrama::Components

Tetragrama/Components/DockspaceUIComponent.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
#include <DockspaceUIComponent.h>
2-
#include <Editor.h>
3-
#include <Helpers/UIDispatcher.h>
4-
#include <Importers/AssimpImporter.h>
5-
#include <MessageToken.h>
6-
#include <Messengers/Messenger.h>
1+
#include <Tetragrama/Components/DockspaceUIComponent.h>
2+
#include <Tetragrama/Editor.h>
3+
#include <Tetragrama/Helpers/UIDispatcher.h>
4+
#include <Tetragrama/MessageToken.h>
5+
#include <Tetragrama/Messengers/Messenger.h>
6+
#include <ZEngine/Importers/AssimpImporter.h>
77
#include <ZEngine/Logging/LoggerDefinition.h>
88
#include <fmt/format.h>
99
#include <imgui/imgui_internal.h>
10+
#include <filesystem>
1011

1112
namespace fs = std::filesystem;
1213

Tetragrama/Components/DockspaceUIComponent.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
2-
#include <Importers/IAssetImporter.h>
3-
#include <Message.h>
4-
#include <Serializers/EditorSceneSerializer.h>
5-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
3+
#include <Tetragrama/Messengers/Message.h>
4+
#include <Tetragrama/Serializers/EditorSceneSerializer.h>
5+
#include <ZEngine/Importers/IAssetImporter.h>
66
#include <imgui.h>
77

88
namespace Tetragrama::Components

Tetragrama/Components/Events/SceneTextureAvailableEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponentEvent.h>
2+
#include <Tetragrama/UIComponentEvent.h>
33

44
namespace Tetragrama::Components::Event
55
{

Tetragrama/Components/Events/SceneViewportFocusedEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponentEvent.h>
2+
#include <Tetragrama/Components/Events/UIComponentEvent.h>
33

44
namespace Tetragrama::Components::Event
55
{

0 commit comments

Comments
 (0)