Fix cmake build with sdk inside a script