Skip to content

Commit b427659

Browse files
committed
Added CMake support, include/ and src/ directories
1 parent 548fd31 commit b427659

File tree

16 files changed

+40
-32
lines changed

16 files changed

+40
-32
lines changed

CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmake_minimum_required(VERSION 3.7.0)
2+
3+
project(CPP-CAN-Parser)
4+
5+
6+
include(CTest)
7+
8+
set(CPPPARSER_INCLUDE_DIRECTORY
9+
${CMAKE_CURRENT_LIST_DIR}/include
10+
)
11+
12+
set(CPPPARSER_SRC_FILES
13+
src/models/CANDatabase.cpp
14+
src/models/CANFrame.cpp
15+
src/parsing/DBCParser.cpp
16+
src/parsing/Tokenizer.cpp)
17+
18+
add_library(cpp_can_parser STATIC ${CPPPARSER_SRC_FILES})
19+
target_include_directories(cpp_can_parser
20+
PUBLIC ${CPPPARSER_INCLUDE_DIRECTORY})
21+
22+
add_executable(dbcLoadStringExec
23+
tests/dbcLoadStringTest.cpp)
24+
target_link_libraries(dbcLoadStringExec cpp_can_parser)
25+
26+
add_test(NAME dbcLoadStringTest
27+
COMMAND dbcLoadStringExec)

Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

bin/.gitkeep

Whitespace-only changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class CANSignal {
5454
return comment_;
5555
}
5656

57-
int scale() const {
57+
double scale() const {
5858
return scale_;
5959
}
6060

61-
int offset() const {
61+
double offset() const {
6262
return offset_;
6363
}
6464

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef DBCParser_H
22
#define DBCParser_H
33

4-
#include "models/CANDatabase.h"
5-
#include "parsing/Tokenizer.h"
4+
#include "CANDatabase.h"
5+
#include "Tokenizer.h"
66
#include <set>
77
#include <memory>
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef ParsingUtils_H
22
#define ParsingUtils_H
33

4-
#include "parsing/Tokenizer.h"
4+
#include "Tokenizer.h"
55
#include <string>
66
#include <iostream>
7-
#include "models/CANDatabaseException.h"
7+
#include "CANDatabaseException.h"
88

99
void throwError(const std::string& category, const std::string& description,
1010
unsigned long long line) {
File renamed without changes.

0 commit comments

Comments
 (0)