-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cmake): Re-order, simplify and comment all cmake
refactor the game folder building
- Loading branch information
Showing
14 changed files
with
145 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Project name | ||
project(R-Type) | ||
|
||
option(BUILD_TESTS "Build the tests" ON) | ||
# Set a directory path in a CMake variable | ||
set(GAME_DIR "${CMAKE_SOURCE_DIR}/Game") | ||
|
||
#R-Type Game | ||
add_subdirectory(R-TypeGame) | ||
# Define a preprocessor macro globally for all targets | ||
add_compile_definitions(GAME_ROOT="${GAME_DIR}") | ||
|
||
#Graphic Library | ||
add_subdirectory(GraphicLibrary) | ||
# Option to build tests | ||
option(BUILD_TESTS "Build the tests" ON) | ||
|
||
#Engine | ||
add_subdirectory(Engine) | ||
# Add subdirectories for different components of the project | ||
add_subdirectory(R-TypeGame) # R-Type Game | ||
add_subdirectory(GraphicLibrary) # Graphic Library | ||
add_subdirectory(Engine) # Engine | ||
|
||
# tests | ||
# Add subdirectory for tests if the option is enabled | ||
if(BUILD_TESTS) | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Add subdirectories for different components of the Engine | ||
add_subdirectory(Client) | ||
add_subdirectory(Server) | ||
add_subdirectory(Shared) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Add subdirectories for different components of the Engine | ||
add_subdirectory(Ecs) | ||
add_subdirectory(Network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Set the C++ standard to C++20 | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# Set the library name | ||
set(LIB r-type_ecs) | ||
|
||
# Set the output directory for the library | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Game/Libs/ECS/) | ||
|
||
# Define source and include paths | ||
set(LIB_SRC_PATH "Src") | ||
set(LIB_INCLUDE_PATH "Include") | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# Define the main source files for the library | ||
set(SRC_LIB | ||
${LIB_SRC_PATH}/Registry.cpp | ||
${LIB_SRC_PATH}/Registry.cpp | ||
) | ||
|
||
# Add the static library target | ||
add_library(${LIB} STATIC ${SRC_LIB}) | ||
|
||
target_include_directories(${LIB} PUBLIC ${INCLUDE_EXE}) | ||
# Include directories for the library target | ||
target_include_directories(${LIB} PUBLIC ${LIB_INCLUDE_PATH}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Add subdirectory for Packet | ||
add_subdirectory(Packet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Set the C++ standard to C++20 | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# Set the library name | ||
set(LIB r-type_packet) | ||
set(LIB_INCLUDE_PATH "Include") | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
# Set the output directory for the library | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Game/Libs/Network/) | ||
|
||
# Define include paths | ||
set(LIB_INCLUDE_PATH "Include") | ||
|
||
# Define the main source files for the library | ||
set(SRC_LIB | ||
NetworkPacket.cpp | ||
NetworkPacket.cpp | ||
) | ||
|
||
# Add the static library target | ||
add_library(${LIB} STATIC ${SRC_LIB}) | ||
|
||
# Find required packages | ||
find_package(asio CONFIG REQUIRED) | ||
|
||
# Link libraries to the library target | ||
target_link_libraries( | ||
${LIB} | ||
PRIVATE asio::asio | ||
) | ||
|
||
target_include_directories(${LIB} PUBLIC ${INCLUDE_EXE}) | ||
# Include directories for the library target | ||
target_include_directories(${LIB} PUBLIC ${LIB_INCLUDE_PATH}) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Set the C++ standard to C++20 | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# Set the output directory for the library | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Game/Config/GraphicLibrary/) | ||
|
||
# Include directories for header files | ||
include_directories( | ||
../Engine/Shared/Interface/ | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Interface/ | ||
) | ||
|
||
# Add a shared library target 'graphic_raylib' | ||
add_library(graphic_raylib SHARED Src/GraphicLib.cpp) | ||
|
||
# Link the 'raylib' library to 'graphic_raylib' | ||
target_link_libraries(graphic_raylib PRIVATE raylib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Add the 'Systems' subdirectory to the build | ||
add_subdirectory(Systems) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# Minimum required version of CMake | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# Set the C++ standard to C++20 | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Game/Config/Systems/) | ||
# Set the output directory for the library | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Game/Config/Systems/) | ||
|
||
# Include directories for header files | ||
include_directories( | ||
../../Engine/Shared/Ecs/Include/ | ||
../../Engine/Shared/Interface/ | ||
../../Engine/Shared/Component/ | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Ecs/Include/ | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Interface/ | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Component/ | ||
) | ||
|
||
# Add a shared library target 'system_initPlayer' | ||
add_library(system_initPlayer SHARED | ||
Players/PlayerInitSystem.cpp | ||
../Components/Life/LifeComponent.cpp | ||
../../Engine/Shared/Component/Position3DComponent.cpp | ||
../../Engine/Shared/Component/ObjPathComponent.cpp) | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Component/Position3DComponent.cpp | ||
${CMAKE_SOURCE_DIR}/Engine/Shared/Component/ObjPathComponent.cpp | ||
) |
Oops, something went wrong.