Added CMakeLists

This commit is contained in:
Łukasz Czyż 2019-11-22 10:10:39 +01:00
parent 0e3317d397
commit 341e63ef2d
5 changed files with 30 additions and 29 deletions

15
CMakeLists.txt Normal file
View file

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.10)
project(svd2cpp)
set(CMAKE_CXX_STANDARD 17)
include_directories(Src)
include_directories(cxxopts/include)
include_directories(tinyxml2)
add_library(ClassBuilder Src/ClassBuilder.cpp)
add_library(XmlParser Src/XmlParser.cpp)
add_library(tinyxml2 tinyxml2/tinyxml2.cpp)
add_executable(svd2cpp Src/main.cpp)
target_link_libraries(svd2cpp ClassBuilder XmlParser tinyxml2)

View file

@ -1,25 +0,0 @@
OBJS = Build/main.o Build/XmlParser.o tinyxml2/libtinyxml2.a
SOURCE = Src/main.cpp tinyxml2/tinyxml2.cpp
INCLUDE = -I tinyxml2 -I cxxopts/include -I Src
OUT = svd2cpp
CC = g++
FLAGS = -g -c -Wall -std=c++17
all: $(OBJS)
$(CC) -g $(OBJS) -o $(OUT) $(LFLAGS)
Build/main.o: Src/main.cpp
mkdir -p Build
$(CC) $(FLAGS) Src/main.cpp $(INCLUDE) -o Build/main.o
Build/XmlParser.o: Src/XmlParser.cpp
mkdir -p Build
$(CC) $(FLAGS) Src/XmlParser.cpp $(INCLUDE) -o Build/XmlParser.o
tinyxml2/libtinyxml2.a:
$(MAKE) -C tinyxml2/ staticlib
clean:
rm -f $(OBJS) $(OUT)

View file

@ -1,6 +1,6 @@
#include <ClassPrinter.hpp>
#include <ClassBuilder.hpp>
ClassPrinter::ClassPrinter(const cxxopts::ParseResult& results,
ClassBuilder::ClassBuilder(const cxxopts::ParseResult& results,
const DeviceInfo& deviceInfo,
const std::vector<Peripheral>& peripherals) :
results(results),

View file

@ -6,9 +6,9 @@
#include <Peripheral.hpp>
#include <vector>
struct ClassPrinter
struct ClassBuilder
{
ClassPrinter(const cxxopts::ParseResult& results,
ClassBuilder(const cxxopts::ParseResult& results,
const DeviceInfo& deviceInfo,
const std::vector<Peripheral>& peripherals);

11
Src/ItemPrinter.hpp Normal file
View file

@ -0,0 +1,11 @@
#ifndef ITEM_PRINTER
#define ITEM_PRINTER
#include <vector>
#include <Peripheral.hpp>
struct ItemPrinter{
};
#endif