-include_directories(${EXTRAS_INCLUDE_DIRS} ${PROJECT_LIBDIR}/openxc-message-format/gen/cpp ${PROJECT_LIBDIR}/nanopb/ ${PROJECT_LIBDIR}/uds-c/src ${PROJECT_LIBDIR}/bitfield-c/src ${PROJECT_LIBDIR}/isotp-c/src)
-link_libraries(${EXTRAS_LIBRARIES})
+add_compile_options(${EXTRAS_CXXFLAGS})
+
+# Needed to compile openxc-message-format library.
+#
+# The reason you need to do this is that some of your messages contain tag
+# numbers or field sizes that are larger than what can fit in the default
+# 8 bit descriptors.
+add_definitions(-DPB_FIELD_16BIT)
+
+# Needed extra directories to hit the required headers files.
+include_directories(${EXTRAS_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR} ${PROJECT_LIBDIR}/openxc-message-format/gen/cpp ${PROJECT_LIBDIR}/nanopb/ ${PROJECT_LIBDIR}/uds-c/src ${PROJECT_LIBDIR}/bitfield-c/src ${PROJECT_LIBDIR}/isotp-c/src)
+
+###########################################################################
+# the library used by the binding : openxc, bitfield, uds, isotp