In my native opinion, I thouht if relative paths are specified, they are considered relative to BASE_DIRS specified dirs, cmake will compose/resolve the final absolute paths of each file items for me. So I don’t understand the meaning of BASE_DIRS parameter in target_sources() command. Can I think this argument is only used for checking the rightness of file items specified by FILES argument?
May anybody help me understand this question? Thank you very much! BEST WISHES!
The purpose of BASE_DIRS is to be able to compute a “root” for each file listed. Without this information, when installing the headers, it is ambiguous how many path components should be preserved upon installation. Should /path/to/some/header/under/directories/header.h be installed to <include>/header.h, <include>/directories/header.h, <include>/under/directories/header.h, or any other possibility? That is what BASE_DIRS is for (and why each file must live under exactly one such BASE_DIRS entry).
Can you tell me where to find the more detailed description about each parameter specified in each cmake command? SO that I wouldn’t have to issue such post to waste your time to solve this kind of questions.