Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
xR3b0rn authored May 29, 2021
2 parents 33b1013 + 2de9d3b commit a72223e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 71 deletions.
130 changes: 65 additions & 65 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@

cmake_minimum_required(VERSION 3.12)

project("libdbcppp" VERSION 0.1.0)

option(build_tests "Build tests" ON)
option(build_examples "Build examples" ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_definitions("/bigobj")
endif()

include_directories("include")
include_directories("third-party/libxml2/include")
include_directories("third-party/libxmlmm/libxmlmm")
include_directories("third-party/boost")
include_directories("third-party/cxxopts/include")

set(LIBXML2_WITH_ICONV OFF)
set(LIBXML2_WITH_LZMA OFF)
set(LIBXML2_WITH_PYTHON OFF)
set(LIBXML2_WITH_ZLIB OFF)
set(LIBXML2_WITH_TESTS OFF)

add_subdirectory(third-party/libxml2)

file(GLOB libxmlmm_header
"third-party/libxmlmm/libxmlmm/*.h"
)
file(GLOB libxmlmm_src
"third-party/libxmlmm/libxmlmm/*.cpp"
)

add_library(libxmlmm SHARED "")
target_link_libraries(libxmlmm LibXml2)

target_sources("libxmlmm"
PRIVATE ${libxmlmm_header}
PRIVATE ${libxmlmm_src}
)

install(
TARGETS "libxmlmm"
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
DIRECTORY "libxmlmm"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxmlmm
FILES_MATCHING PATTERN "*.h")

add_subdirectory(src)
if (build_tests)
add_subdirectory(tests)
endif()
if (build_examples)
add_subdirectory(examples)
endif()

set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

cmake_minimum_required(VERSION 3.12)

project("libdbcppp" VERSION 0.1.0)

option(build_tests "Build tests" ON)
option(build_examples "Build examples" ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_definitions("/bigobj")
endif()

include_directories("include")
include_directories("third-party/libxml2/include")
include_directories("third-party/libxmlmm/libxmlmm")
include_directories("third-party/boost")
include_directories("third-party/cxxopts/include")

set(LIBXML2_WITH_ICONV OFF)
set(LIBXML2_WITH_LZMA OFF)
set(LIBXML2_WITH_PYTHON OFF)
set(LIBXML2_WITH_ZLIB OFF)
set(LIBXML2_WITH_TESTS OFF)

add_subdirectory(third-party/libxml2)

file(GLOB libxmlmm_header
"third-party/libxmlmm/libxmlmm/*.h"
)
file(GLOB libxmlmm_src
"third-party/libxmlmm/libxmlmm/*.cpp"
)

add_library(libxmlmm SHARED "")
target_link_libraries(libxmlmm LibXml2)

target_sources("libxmlmm"
PRIVATE ${libxmlmm_header}
PRIVATE ${libxmlmm_src}
)

install(
TARGETS "libxmlmm"
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
DIRECTORY "libxmlmm"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxmlmm
FILES_MATCHING PATTERN "*.h")

add_subdirectory(src)
if (build_tests)
add_subdirectory(tests)
endif()
if (build_examples)
add_subdirectory(examples)
endif()

set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ int main()
if (dbcppp_MessageId(tmp) == frame.can_id)
{
printf("Received message: %s\n", dbcppp_MessageGetName(msg));
void print_signal_data(const dbcppp_Signal* sig, void* data)
{
uint64_t raw = dbcppp_SignalDecode(sig, frame->data);
double phys = dbcppp_SignalRawToPhys(sig, raw);
printf("\t%s=%f\n", dbcppp_SignalGetName(sig), phys);
}
dbcppp_MessageForEachSignal(msg, print_signal_data, &frame);
for (uint64_t i = 0; i < dbcppp_MessageSignals_Size(msg); i++)
{
Expand Down

0 comments on commit a72223e

Please sign in to comment.