Skip to content

Commit

Permalink
Basic structure of repo created using conanfile, cmakelists and gtest.
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyXorb committed Aug 27, 2022
0 parents commit dc7c2d8
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AccessModifierOffset: -3
BasedOnStyle: Chromium
BreakBeforeBraces: Allman
ColumnLimit: '120'
IndentWidth: '3'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
UseTab: Never
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.vscode
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# MagicParams
30 changes: 30 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -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"]
6 changes: 6 additions & 0 deletions include/magic_params.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <unordered_map>

class MagicParams
{

};
8 changes: 8 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#include <iostream>
#include <magic_params.hpp>

int main()
{
std::cout << "HELLO!";
}
11 changes: 11 additions & 0 deletions tests/test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "gtest/gtest.h"

#include "magic_params.hpp"
class MagicParamsTester : public ::testing::Test
{
};

TEST_F(MagicParamsTester, simpletest)
{
EXPECT_TRUE(true);
};

0 comments on commit dc7c2d8

Please sign in to comment.