add_executable(lexTest test.cpp) add_custom_target(check-lexTest COMMAND lexTest WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )