cmake: improve scripts