diff --git a/CMakeLists.txt b/CMakeLists.txt index 5df4c9f..1bb18ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,4 +10,5 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_FLAGS -Wall) -add_subdirectory("aster_core") +add_subdirectory("aster") +add_subdirectory("triangle") diff --git a/aster_core/CMakeLists.txt b/aster/CMakeLists.txt similarity index 62% rename from aster_core/CMakeLists.txt rename to aster/CMakeLists.txt index 78d006e..7eb0333 100644 --- a/aster_core/CMakeLists.txt +++ b/aster/CMakeLists.txt @@ -10,18 +10,17 @@ find_package(Vulkan REQUIRED) find_package(fmt CONFIG REQUIRED) find_package(VulkanMemoryAllocator CONFIG REQUIRED) -set(HEADER_FILES "constants.h" "config.h" "logger.h" "global.h" "context.h" "window.h") -set(SOURCE_FILES "logger.cpp" "global.cpp" "context.cpp" "window.cpp") +set(HEADER_FILES constants.h config.h logger.h global.h context.h window.h) +set(SOURCE_FILES logger.cpp global.cpp context.cpp window.cpp) -add_library(aster_core ${SOURCE_FILES} ${HEADER_FILES}) +add_library(aster_core STATIC ${SOURCE_FILES} ${HEADER_FILES}) set_property(TARGET aster_core PROPERTY CXX_STANDARD 20) -target_link_libraries(aster_core PRIVATE glm::glm-header-only) +target_include_directories(aster_core PUBLIC ${CMAKE_SOURCE_DIR}) + +target_link_libraries(aster_core PUBLIC glm::glm-header-only) target_link_libraries(aster_core PRIVATE glfw) target_include_directories(aster_core PRIVATE ${SCOTTT_DEBUGBREAK_INCLUDE_DIRS}) target_link_libraries(aster_core PRIVATE fmt::fmt) target_link_libraries(aster_core PRIVATE Vulkan::Vulkan Vulkan::Headers GPUOpen::VulkanMemoryAllocator) -add_executable(aster_exe "aster.cpp") -target_link_libraries(aster_exe PRIVATE aster_core) -target_link_libraries(aster_exe PRIVATE glm::glm-header-only) diff --git a/aster_core/config.h b/aster/config.h similarity index 100% rename from aster_core/config.h rename to aster/config.h diff --git a/aster_core/constants.h b/aster/constants.h similarity index 100% rename from aster_core/constants.h rename to aster/constants.h diff --git a/aster_core/context.cpp b/aster/context.cpp similarity index 100% rename from aster_core/context.cpp rename to aster/context.cpp diff --git a/aster_core/context.h b/aster/context.h similarity index 100% rename from aster_core/context.h rename to aster/context.h diff --git a/aster_core/glfw_context.h b/aster/glfw_context.h similarity index 100% rename from aster_core/glfw_context.h rename to aster/glfw_context.h diff --git a/aster_core/global.cpp b/aster/global.cpp similarity index 100% rename from aster_core/global.cpp rename to aster/global.cpp diff --git a/aster_core/global.h b/aster/global.h similarity index 100% rename from aster_core/global.h rename to aster/global.h diff --git a/aster_core/logger.cpp b/aster/logger.cpp similarity index 100% rename from aster_core/logger.cpp rename to aster/logger.cpp diff --git a/aster_core/logger.h b/aster/logger.h similarity index 100% rename from aster_core/logger.h rename to aster/logger.h diff --git a/aster_core/window.cpp b/aster/window.cpp similarity index 100% rename from aster_core/window.cpp rename to aster/window.cpp diff --git a/aster_core/window.h b/aster/window.h similarity index 100% rename from aster_core/window.h rename to aster/window.h diff --git a/triangle/CMakeLists.txt b/triangle/CMakeLists.txt new file mode 100644 index 0000000..449ca9c --- /dev/null +++ b/triangle/CMakeLists.txt @@ -0,0 +1,8 @@ +# CMakeList.txt ; CMake project for Aster Core + +cmake_minimum_required(VERSION 3.13) + +add_executable(aster_exe "aster.cpp") +add_dependencies(aster_exe aster_core) + +target_link_libraries(aster_exe PRIVATE aster_core) diff --git a/aster_core/aster.cpp b/triangle/aster.cpp similarity index 67% rename from aster_core/aster.cpp rename to triangle/aster.cpp index b322f75..cec0222 100644 --- a/aster_core/aster.cpp +++ b/triangle/aster.cpp @@ -1,12 +1,15 @@ -#include "constants.h" -#include "glfw_context.h" -#include "window.h" +#include "aster/constants.h" +#include "aster/glfw_context.h" +#include "aster/window.h" int main(int, char **) { GlfwContext *glfw = new GlfwContext(); Context *context = new Context("Aster", VERSION); Window *window = new Window("Aster1", context, { 640, 480 }); + while (window->poll()) { + } + delete window; delete context; delete glfw;