This is the way how I compile my cpp code:
g++ -I/usr/local/include/modbus `pkg-config glib-2.0 --cflags --libs` -L/usr/local/lib -lmodbus test-modbus.c -o test-modbus
with gcc it is working pretty fine. But I need to place it into CmakeList.txt and I tried this:
SET(GCC_COVERAGE_COMPILE_FLAGS "-I/usr/local/include/modbus -L/usr/local/lib")
SET(GCC_COVERAGE_LINK_FLAGS "-lmodbus")
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}" )
But with no success. Any ideas?