set(url https://raw.githubusercontent.com/commontk/CTK/master/CMake/ctkDashboardDriverScript.cmake) set(dest ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}.github.driver) file(DOWNLOAD ${url} ${dest} STATUS status) list(GET status 0 error_code) list(GET status 1 error_msg) if(error_code) message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}") endif() include(${dest})