CONGE-1 - Initial commit with seperation of the engine from the demo application

This commit is contained in:
Jimmy Tremblay-Bernier 2024-11-15 09:47:17 -05:00
commit 1842376ddf
15 changed files with 124 additions and 0 deletions

13
.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
.idea/
bin/
intermediates/
[Bb]uild/
CMakeFiles/
Testing/
Conan/
.cmake/
CMakeCache.txt
build.ninja
cmake_install.cmake
CMakeCache.txt
.ninja*

19
CMakeLists.txt Normal file
View File

@ -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)

3
ConjureEngine/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
CMakeFiles/
cmake_install.cmake
CMakeUserPresets.json

View File

@ -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)

View File

@ -0,0 +1,8 @@
[requires]
glm/cci.20230113
sdl/2.30.8
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout

View File

View File

@ -0,0 +1,10 @@
//
// Created by Jimmy Tremblay-bernier on 2024-11-14.
//
#include "ConjureEngine.h"
#include <cstdio>
void ConjureEngine::SayHello()
{
printf("Hello World\n");
}

View File

@ -0,0 +1,4 @@
#pragma once
namespace ConjureEngine {
void SayHello();
}

View File

3
Demo1/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
CMakeFiles/
cmake_install.cmake
CMakeUserPresets.json

23
Demo1/CMakeLists.txt Normal file
View File

@ -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)

8
Demo1/conanfile.txt Normal file
View File

@ -0,0 +1,8 @@
[requires]
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout

0
Demo1/docs/.gitkeep Normal file
View File

6
Demo1/src/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "ConjureEngine/ConjureEngine.h"
int main(int argc, char** argv) {
ConjureEngine::SayHello();
return 0;
}

0
Demo1/tests/.gitkeep Normal file
View File