-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d0ce7c
commit 6e4be32
Showing
16 changed files
with
184 additions
and
113 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
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 |
---|---|---|
|
@@ -9,3 +9,7 @@ compile_commands.json | |
CMakeUserPresets.json | ||
.scannerwork | ||
sonar-project.properties | ||
.conan | ||
.venv | ||
|
||
lib/GUI/bindings |
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,24 +1,29 @@ | ||
cmake_minimum_required(VERSION 3.28) | ||
|
||
cmake_policy(SET CMP0167 NEW) | ||
cmake_minimum_required(VERSION 3.26) | ||
|
||
project(NexusNodeFramework) | ||
|
||
# option to enable/disable testing | ||
option(ENABLE_TESTING "Enable testing" ON) | ||
# option to enable/disable building the GUI | ||
option(BUILD_GUI "Build the GUI" ON) | ||
|
||
enable_testing() | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
add_executable(POACS main.cpp) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
add_subdirectory(lib/Core) | ||
add_subdirectory(lib/Network) | ||
#add_subdirectory(lib/Graphics) | ||
add_subdirectory(lib/GUI) | ||
|
||
target_link_libraries(POACS PRIVATE IRCCore IRCNetwork) | ||
if(BUILD_GUI) | ||
add_subdirectory(lib/GUI) | ||
|
||
add_executable(graphics_test test_graphics.cpp) | ||
target_link_libraries(graphics_test IRCNetwork IRCGui) | ||
endif() | ||
|
||
add_subdirectory(tests) | ||
if (ENABLE_TESTING) | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
add_executable(graphics_test test_graphics.cpp) | ||
target_link_libraries(graphics_test IRCNetwork IRCGui) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import os | ||
from conan import ConanFile | ||
from conan.tools.files import copy | ||
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps | ||
|
||
# you may need the option: | ||
# -c tools.system.package_manager:mode=install | ||
# -c tools.system.package_manager:sude=True | ||
|
||
# Options can be passed with the command line with the following syntax: | ||
# -o nnf/*:shared=True -o nnf/*:with_tests=False -o nnf/*:with_gui=True | ||
|
||
class NexusNodeFramework(ConanFile): | ||
name = "nnf" | ||
version = "0.1" | ||
|
||
# Binary configuration | ||
settings = "os", "compiler", "build_type" | ||
options = {"shared": [True, False], "with_tests": [True, False], "with_gui": [True, False]} | ||
default_options = {"shared": False, "with_tests": True, "with_gui": True} | ||
|
||
def requirements(self): | ||
self.requires("boost/[~1]") | ||
if self.options.with_gui: | ||
self.requires("imgui/[~1]") | ||
self.requires("glad/[~0]") | ||
self.requires("glfw/[~3]") | ||
if self.options.with_tests: | ||
self.requires("gtest/[~1]") | ||
|
||
def build_requirements(self): | ||
self.tool_requires("cmake/[~3]") | ||
self.tool_requires("ninja/[~1]") | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
# configure the output of the conan files to '.conan' in linux | ||
# in windows will be in 'build' | ||
multi = True if self.settings.get_safe("compiler") == "msvc" else False | ||
if multi: | ||
self.folders.generators = os.path.join("build", "generators") | ||
self.folders.build = "build" | ||
else: | ||
self.folders.generators = os.path.join(".conan", str(self.settings.build_type), "generators") | ||
self.folders.build = os.path.join(".conan", str(self.settings.build_type)) | ||
|
||
def generate(self): | ||
# imports the backend render from imgui into the folder bindings | ||
if self.options.with_gui: | ||
copy(self, "*glfw*", os.path.join(self.dependencies["imgui"].package_folder, | ||
"res", "bindings"), os.path.join(self.source_folder, "lib/GUI/bindings")) | ||
copy(self, "*opengl3*", os.path.join(self.dependencies["imgui"].package_folder, | ||
"res", "bindings"), os.path.join(self.source_folder, "lib/GUI/bindings")) | ||
|
||
# Generates the project files from cmake | ||
deps = CMakeDeps(self) | ||
deps.generate() | ||
|
||
tc = CMakeToolchain(self, | ||
generator="Ninja") | ||
tc.variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = "ON" | ||
tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type | ||
# pass the option BUILD_GUI to the cmake | ||
tc.variables["BUILD_GUI"] = self.options.with_gui | ||
tc.variables["ENABLE_TESTING"] = self.options.with_tests | ||
tc.generate() | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
cmake = CMake(self) | ||
cmake.install() | ||
|
||
|
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,31 +1,46 @@ | ||
cmake_minimum_required(VERSION 3.28) | ||
cmake_minimum_required(VERSION 3.26) | ||
project(IRCCore) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(H_FILES) | ||
set(CPP_FILES) | ||
function(add_class CLASS_NAME) | ||
# Append the header and source file paths to the global lists | ||
list(APPEND H_FILES "src/Core/${CLASS_NAME}.h") | ||
list(APPEND CPP_FILES "src/Core/${CLASS_NAME}.cpp") | ||
|
||
find_package(Boost REQUIRED COMPONENTS signals2) | ||
# Set the variables in the parent scope (CMakeLists.txt where the function is called) | ||
set(H_FILES "${H_FILES}" PARENT_SCOPE) | ||
set(CPP_FILES "${CPP_FILES}" PARENT_SCOPE) | ||
endfunction() | ||
|
||
find_package(Boost REQUIRED) | ||
|
||
add_class(Application) | ||
add_class(CommandLineParser) | ||
add_class(Node) | ||
add_class(NodePtr) | ||
add_class(Timer) | ||
|
||
add_library(IRCCore STATIC | ||
src/Core/Application.cpp | ||
src/Core/Application.h | ||
src/Core/CommandLineParser.cpp | ||
src/Core/CommandLineParser.h | ||
src/Core/pch.h | ||
src/Core/Node.cpp | ||
src/Core/Node.h | ||
src/Core/NodePtr.cpp | ||
src/Core/NodePtr.h | ||
src/Core/Timer.h | ||
src/Core/Timer.cpp | ||
${H_FILES} | ||
${CPP_FILES} | ||
) | ||
|
||
target_precompile_headers(IRCCore PUBLIC | ||
src/Core/pch.h | ||
) | ||
|
||
set_target_properties(IRCCore PROPERTIES PUBLIC_HEADER "${H_FILES}") | ||
|
||
target_include_directories(IRCCore PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/src | ||
) | ||
|
||
target_link_libraries(IRCCore PUBLIC Boost::signals2) | ||
target_link_libraries(IRCCore PUBLIC boost::boost) | ||
|
||
# Install the library, the library should be in the lib folder | ||
# and the headers should be in the include folder | ||
install(TARGETS IRCCore | ||
LIBRARY DESTINATION lib | ||
PUBLIC_HEADER DESTINATION include/IRCCore | ||
) |
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,5 +1,3 @@ | ||
#include <glad/glad.h> | ||
|
||
#include "GUI/GUIWindow.h" | ||
|
||
#include "Core/Application.h" | ||
|
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
Oops, something went wrong.