commit 1842376ddf1fe3fe6709d3ac66ddca6a0f5f8725 Author: Jimmy Tremblay-Bernier Date: Fri Nov 15 09:47:17 2024 -0500 CONGE-1 - Initial commit with seperation of the engine from the demo application diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d7f31d --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +.idea/ +bin/ +intermediates/ +[Bb]uild/ +CMakeFiles/ +Testing/ +Conan/ +.cmake/ +CMakeCache.txt +build.ninja +cmake_install.cmake +CMakeCache.txt +.ninja* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..eec78fb --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.29) +project(ConjureEngineProject) + +# Set the default build type to Debug if not specified by the user +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (default Debug)" FORCE) +endif() + +set(CONAN_DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/Conan) + +execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR}/ConjureEngine --output-folder=${CONAN_DEPENDENCIES_DIR} --build=missing) +execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR}/Demo1 --output-folder=${CONAN_DEPENDENCIES_DIR} --build=missing) + +set(CMAKE_TOOLCHAIN_FILE "${CONAN_DEPENDENCIES_DIR}/build/Release/generators/conan_toolchain.cmake" CACHE FILEPATH "Conan toolchain file") +set(CMAKE_PREFIX_PATH "${CONAN_DEPENDENCIES_DIR}/build/Release/generators" ${CMAKE_PREFIX_PATH}) +set(CMAKE_MODULE_PATH "${CONAN_DEPENDENCIES_DIR}/build/Release/generators" ${CMAKE_MODULE_PATH}) + +add_subdirectory(./ConjureEngine) +add_subdirectory(./Demo1) \ No newline at end of file diff --git a/ConjureEngine/.gitignore b/ConjureEngine/.gitignore new file mode 100644 index 0000000..e210f52 --- /dev/null +++ b/ConjureEngine/.gitignore @@ -0,0 +1,3 @@ +CMakeFiles/ +cmake_install.cmake +CMakeUserPresets.json \ No newline at end of file diff --git a/ConjureEngine/CMakeLists.txt b/ConjureEngine/CMakeLists.txt new file mode 100644 index 0000000..909c6f8 --- /dev/null +++ b/ConjureEngine/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.29) +project(ConjureEngine) + +set(CMAKE_CXX_STANDARD 17) + +# Set the architecture (assuming you're passing the architecture as a CMake variable) +# Replace 'x64' with your system's architecture, or set this dynamically based on the system +if(NOT DEFINED ARCH) + set(ARCH x64) # You can change this to x86 or any other architecture you are targeting +endif() + + + +# Set common output directories +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/intermediates/${ARCH}/${PROJECT_NAME}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${ARCH}/${PROJECT_NAME}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${ARCH}/${PROJECT_NAME}) + +find_package(glm REQUIRED) +find_package(Vulkan REQUIRED) + +add_library(${PROJECT_NAME} STATIC src/ConjureEngine/ConjureEngine.h src/ConjureEngine/ConjureEngine.cpp) + +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) + +# Specify include directories +target_include_directories(ConjureEngine PUBLIC include) \ No newline at end of file diff --git a/ConjureEngine/conanfile.txt b/ConjureEngine/conanfile.txt new file mode 100644 index 0000000..bb54b29 --- /dev/null +++ b/ConjureEngine/conanfile.txt @@ -0,0 +1,8 @@ +[requires] +glm/cci.20230113 +sdl/2.30.8 +[generators] +CMakeDeps +CMakeToolchain +[layout] +cmake_layout \ No newline at end of file diff --git a/ConjureEngine/docs/.gitkeep b/ConjureEngine/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ConjureEngine/src/ConjureEngine/ConjureEngine.cpp b/ConjureEngine/src/ConjureEngine/ConjureEngine.cpp new file mode 100644 index 0000000..107dd0c --- /dev/null +++ b/ConjureEngine/src/ConjureEngine/ConjureEngine.cpp @@ -0,0 +1,10 @@ +// +// Created by Jimmy Tremblay-bernier on 2024-11-14. +// +#include "ConjureEngine.h" +#include + +void ConjureEngine::SayHello() +{ + printf("Hello World\n"); +} \ No newline at end of file diff --git a/ConjureEngine/src/ConjureEngine/ConjureEngine.h b/ConjureEngine/src/ConjureEngine/ConjureEngine.h new file mode 100644 index 0000000..b2a96c2 --- /dev/null +++ b/ConjureEngine/src/ConjureEngine/ConjureEngine.h @@ -0,0 +1,4 @@ +#pragma once +namespace ConjureEngine { + void SayHello(); +} diff --git a/ConjureEngine/tests/.gitkeep b/ConjureEngine/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Demo1/.gitignore b/Demo1/.gitignore new file mode 100644 index 0000000..e210f52 --- /dev/null +++ b/Demo1/.gitignore @@ -0,0 +1,3 @@ +CMakeFiles/ +cmake_install.cmake +CMakeUserPresets.json \ No newline at end of file diff --git a/Demo1/CMakeLists.txt b/Demo1/CMakeLists.txt new file mode 100644 index 0000000..0eec459 --- /dev/null +++ b/Demo1/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.29) +project(Demo1) + +set(CMAKE_CXX_STANDARD 17) + +# Set the architecture (assuming you're passing the architecture as a CMake variable) +# Replace 'x64' with your system's architecture, or set this dynamically based on the system +if(NOT DEFINED ARCH) + set(ARCH x64) # You can change this to x86 or any other architecture you are targeting +endif() + +# Set common output directories +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/intermediates/${ARCH}/${PROJECT_NAME}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${ARCH}/${PROJECT_NAME}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${ARCH}/${PROJECT_NAME}) + +add_executable(${PROJECT_NAME} src/main.cpp) + +target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/ConjureEngine) + +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ConjureEngine) +target_include_directories(${PROJECT_NAME} PRIVATE include) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/ConjureEngine/src) diff --git a/Demo1/conanfile.txt b/Demo1/conanfile.txt new file mode 100644 index 0000000..bc6f23d --- /dev/null +++ b/Demo1/conanfile.txt @@ -0,0 +1,8 @@ +[requires] + +[generators] +CMakeDeps +CMakeToolchain + +[layout] +cmake_layout \ No newline at end of file diff --git a/Demo1/docs/.gitkeep b/Demo1/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Demo1/src/main.cpp b/Demo1/src/main.cpp new file mode 100644 index 0000000..5668f0f --- /dev/null +++ b/Demo1/src/main.cpp @@ -0,0 +1,6 @@ +#include "ConjureEngine/ConjureEngine.h" + +int main(int argc, char** argv) { + ConjureEngine::SayHello(); + return 0; +} \ No newline at end of file diff --git a/Demo1/tests/.gitkeep b/Demo1/tests/.gitkeep new file mode 100644 index 0000000..e69de29