[CMake] how to set current source directory relative to external project

Marc Herbert marc.herbert at gmail.com
Sun Jul 14 01:44:08 EDT 2019


Le mar. 9 juil. 2019 à 13:24, hex <hex7c3 at gmail.com> a écrit :

> Now that I look at it it seems very obvious. I still have doubts, though:
>
> I guess I am seeing the contents of a build directory as somewhat
> volatile. For most files I want that, to either clean the project or
> override the files.
>
> But what about files I want to archive, such as a tarball or zipped
> documentation: does it make sense to place them into the build directory?
> The files belong to the project, though are not source controlled but
> aren't install targets either.
>
How would CMake know that these tarballs are in a somewhat final version
that you want to archive as opposed to a state where they haven't passed
the most basic tests yet? I would implement this outside CMake: wherever is
the information that guides the decision to archive. When that decision is
made then some script would simply "exfiltrate" the tarballs and whatever
else from the build/ directory before it gets cleaned. Sounds like
something CI does every day.

This being said, CPack seems to have a ton of documented and undocumented
(read: Stackoverflow) options, hopefully some of them do what you want.

Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190713/a2e35e0c/attachment.html>


More information about the CMake mailing list