How can I make the content returned by the CMake File API independent of the files generated after configuring with CMake?

For example, in an actual project, I used the CMake File API to retrieve the include path of a target as “C:/Users/Jason/OneDrive/Desktop/CMakeTest/opencv-4.7.0/build/3rdparty/libtiff”. The project folder is “opencv-4.7.0”, and the files linked by this target are located in the project’s “build” folder. This path is generated based on my CMake configuration and does not exist in the original source code of the project.

I want the include path that is independent of the configuration. It should be located in a folder outside the “build” folder within the project. Is there a way to obtain it? Thank you!

A similar situation exists for the command fragments in the link section, where the linked library is “-Wl,-rpath,C:/Users/iever/OneDrive/Desktop/CMakeTest/opencv-4.7.0/build/lib”.

CMake, in general, does not make relocatable builds (in that the generated tree cannot be moved; the installed artifacts can be relocatable however).