diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..7db1246 --- /dev/null +++ b/.clang-format @@ -0,0 +1,9 @@ +AccessModifierOffset: -3 +BasedOnStyle: Chromium +BreakBeforeBraces: Allman +ColumnLimit: '120' +IndentWidth: '3' +Language: Cpp +MaxEmptyLinesToKeep: '1' +NamespaceIndentation: None +UseTab: Never \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1899660 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +.vscode \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7e240dc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.13) + +PROJECT("magicparams") + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(magicparams) +add_executable(magicparamstests) + +target_link_libraries(magicparamstests PRIVATE CONAN_PKG::gtest) + +target_include_directories(magicparams PUBLIC include) +target_include_directories(magicparamstests PRIVATE include) + +target_sources(magicparams PUBLIC include/magic_params.hpp) +target_sources(magicparams PRIVATE src/main.cpp) +target_sources(magicparamstests PRIVATE tests/test.cpp) \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..56b3318 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# MagicParams \ No newline at end of file diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..a4f5ea4 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,30 @@ +from importlib.metadata import requires +from conans import ConanFile, CMake, tools + + +class MagicParams(ConanFile): + name = "magicparams" + version = "1.0" + author = "EddyXorb" + description = "Map enum values to different plain old datatypes and string and check and set and retrieve them without having to remember which parameter maps to which type. " + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + generators = "cmake" + exports_sources = "*" + requires = "gtest/1.12.1" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def build(self): + cmake = CMake(self) + cmake.configure(".") + cmake.build() + + def package(self): + self.copy("*.hpp", dst="include", src="include") + + def package_info(self): + self.cpp_info.libs = ["enummap"] diff --git a/include/magic_params.hpp b/include/magic_params.hpp new file mode 100644 index 0000000..1abd36b --- /dev/null +++ b/include/magic_params.hpp @@ -0,0 +1,6 @@ +#include + +class MagicParams +{ + +}; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d7c88b2 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,8 @@ + +#include +#include + +int main() +{ + std::cout << "HELLO!"; +} diff --git a/tests/test.cpp b/tests/test.cpp new file mode 100644 index 0000000..b6155a6 --- /dev/null +++ b/tests/test.cpp @@ -0,0 +1,11 @@ +#include "gtest/gtest.h" + +#include "magic_params.hpp" +class MagicParamsTester : public ::testing::Test +{ +}; + +TEST_F(MagicParamsTester, simpletest) +{ + EXPECT_TRUE(true); +}; \ No newline at end of file