find_package(FLEX REQUIRED) FLEX_TARGET(GMT_hfScanner ${moddir}/gmt_filter_headfoot.l ${CMAKE_CURRENT_BINARY_DIR}/gmt_filter_headfoot.cpp COMPILE_FLAGS "--header-file=${CMAKE_CURRENT_BINARY_DIR}/gmt_filter_headfoot.h") set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES gmt_filter_headfoot.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) find_package(GMT REQUIRED) set(MODULE_ADDITIONAL_SOURCES ${FLEX_GMT_hfScanner_OUTPUTS}) set(MODULE_ADDITIONAL_INCLUDES ${GMT_INCLUDE_DIR}) set(MODULE_ADDITIONAL_LIBRARIES ${GMT_LIBRARIES})