add_custom_target(CustomTarget) export(TARGETS CustomTarget FILE somefile.cmake)