diff --git a/CMakeLists.txt b/CMakeLists.txt index c16c4b72..e0917d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.md b/README.md index 887134fd..23efbc97 100644 --- a/README.md +++ b/README.md @@ -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++) {