From 9bd3d4fbcbd32709a5e52de166f67d6980a09f42 Mon Sep 17 00:00:00 2001 From: fzurita Date: Sat, 27 Feb 2021 10:29:23 -0500 Subject: [PATCH] Created project for Netplay Room Manager --- .gitignore | 2 ++ CMakeLists.txt | 11 +++++++++++ build.sh | 7 +++++++ conanfile.txt | 7 +++++++ src/main.cpp | 25 +++++++++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100755 build.sh create mode 100644 conanfile.txt create mode 100644 src/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da63913 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/* + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..236cccf --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.10) +project(netplayroom-manager) + +add_definitions("-std=c++17") + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(np-room-manager src/main.cpp) +target_link_libraries(np-room-manager ${CONAN_LIBS}) + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0578095 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir -p build +cd build +conan install .. +cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release +cmake --build . diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..87b23cb --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,7 @@ +[requires] +spdlog/1.8.2 + +[generators] +cmake + + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..1f43d50 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,25 @@ +#include "spdlog/spdlog.h" + +int main() +{ + spdlog::info("Welcome to spdlog!"); + spdlog::error("Some error message with arg: {}", 1); + + spdlog::warn("Easy padding in numbers like {:08d}", 12); + spdlog::critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42); + spdlog::info("Support for floats {:03.2f}", 1.23456); + spdlog::info("Positional args are {1} {0}..", "too", "supported"); + spdlog::info("{:<30}", "left aligned"); + + spdlog::set_level(spdlog::level::debug); // Set global log level to debug + spdlog::debug("This message should be displayed.."); + + // change log pattern + spdlog::set_pattern("[%H:%M:%S %z] [%n] [%^---%L---%$] [thread %t] %v"); + + // Compile time log levels + // define SPDLOG_ACTIVE_LEVEL to desired level + SPDLOG_TRACE("Some trace message with param {}", 42); + SPDLOG_DEBUG("Some debug message"); +} +