First time here? Check out the FAQ!
A simple solution is cmake -D BUILD_SHARED_LIBS=OFF. Static libraries do not use relative path.
cmake -D BUILD_SHARED_LIBS=OFF