Fix cmake and the program for system-wide installs based on a prefix