IF(NOT OBD_DISABLE_GUI)
	IF(NOT FLTK_FLUID_EXECUTABLE)
		MESSAGE(STATUS "Couldn't find fluid: required for building GUI")
	ENDIF(NOT FLTK_FLUID_EXECUTABLE)
	IF(NOT FLTK_FOUND)
		MESSAGE(STATUS "Couldn't find fltk: required for building GUI")
	ENDIF(NOT FLTK_FOUND)

	FIND_PACKAGE(fftw3)
	IF(NOT FFTW3_FOUND)
		MESSAGE(STATUS "Couldn't find fftw3: required for building obdfft")
	ENDIF(NOT FFTW3_FOUND)


	IF(FLTK_FOUND AND FLTK_FLUID_EXECUTABLE AND FFTW3_FOUND)

		INCLUDE_DIRECTORIES(
			.
			../obdinfo/
			${FLTK_INCLUDE_DIR}
			${FFTW3_INCLUDE_DIR}
		)

		FILE(GLOB OBDFFT_FL_GLOB
			fftwindow.fl
		)

		# GLOB includes a bunch of path prefix which confuses FLTK_WRAP_UI
		FOREACH(OBDFFT_FL_SRC ${OBDFFT_FL_GLOB})
			GET_FILENAME_COMPONENT(ONE_FL_SRC ${OBDFFT_FL_SRC} NAME)
			SET(OBDFFT_FL_SRCS ${OBDFFT_FL_SRCS} ${ONE_FL_SRC})
		ENDFOREACH(OBDFFT_FL_SRC)

		FLTK_WRAP_UI(ckobdfft ${OBDFFT_FL_SRCS})

		ADD_LIBRARY(ckobdfft STATIC ${ckobdfft_FLTK_UI_SRCS})


		SET(OBDFFT_SRCS fftmain.cpp)

		SET(OBDFFT_LIBS
			ckobdfft
			${CKSQLITE_LIBRARIES}
			ckobdinfo
			${FLTK_LIBRARIES}
			${FFTW3_LIBRARY}
		)

		ADD_EXECUTABLE(obdfft ${OBDFFT_SRCS})

		TARGET_LINK_LIBRARIES(obdfft ${OBDFFT_LIBS})

		# INSTALL(TARGETS obdfft
			# RUNTIME DESTINATION bin)
		# INSTALL(FILES ${OBDGPSLogger_SOURCE_DIR}/man/man1/obdfft.1
			# DESTINATION share/man/man1)


	ENDIF(FLTK_FOUND AND FLTK_FLUID_EXECUTABLE AND FFTW3_FOUND)
ENDIF(NOT OBD_DISABLE_GUI)

SET(OBDTRIPCOMPARE_SRCS
	tripcompare.c
	examinetrips.c
	analysistables.c
)

SET(OBDTRIPCOMPARE_LIBS ${CKSQLITE_LIBRARIES} m)

ADD_EXECUTABLE(obdtripcompare ${OBDTRIPCOMPARE_SRCS})
TARGET_LINK_LIBRARIES(obdtripcompare ${OBDTRIPCOMPARE_LIBS})


SET(OBDBOXWHISKER_SRCS
	boxwhisker.c
)

SET(OBDBOXWHISKER_LIBS ${CKSQLITE_LIBRARIES} ckobdinfo m)

ADD_EXECUTABLE(obdboxwhisker ${OBDBOXWHISKER_SRCS})
TARGET_LINK_LIBRARIES(obdboxwhisker ${OBDBOXWHISKER_LIBS})



