INCLUDE_DIRECTORIES(
	.
)

FILE(GLOB OBDCSV_SRCS
	*.c *.h
)

SET(OBDCSV_LIBS
	${CKSQLITE_LIBRARIES}
)

FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
	SET(OBDCSV_LIBS ${OBDCSV_LIBS} ${ZLIB_LIBRARIES})
	INCLUDE_DIRECTORIES(ZLIB_INCLUDE_DIR)
	ADD_DEFINITIONS(-DHAVE_ZLIB)
ELSE(ZLIB_FOUND)
	MESSAGE(STATUS "Couldn't find zlib. Will not compile gzip support in obd2csv")
ENDIF(ZLIB_FOUND)

ADD_EXECUTABLE(obd2csv ${OBDCSV_SRCS})

TARGET_LINK_LIBRARIES(obd2csv ${OBDCSV_LIBS})

INSTALL(TARGETS obd2csv
	RUNTIME DESTINATION bin)

INSTALL(FILES ${OBDGPSLogger_SOURCE_DIR}/man/man1/obd2csv.1
	DESTINATION share/man/man1)

