-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build artifacts in source directory #133
Comments
Arguably, the compilation results are placed in Do you have a specific case in mind where this is problematic? |
It prevents thoroughly nuking a build by simply removing the build directory; CMake users tend to expect this to work. Multiple build trees from a single source will be horribly broken. Also, it grossly violates Standard Practice. (In general, it should be possible to build a CMake project with the source in a read-only mount point. Note also that it is "source directory", singular, i.e. the root of the git clone, which usually matches
Can you show me another project that does this? I've seen quite a few projects using CMake, and I can't think of a single one besides octomap that forces its build artifacts to be in the source tree in this manner. (I'm ignoring ones using To be clear: the problem isn't putting all the libraries in |
The projects that I had in mind were not necessarily CMake projects, and the layout originates from a time when building completely in-source was common so maybe that's an explanation. All basic instructions I've come across actually tell you to create Your scenarios all make sense to support, so the change is best planned for the next major release. Could you provide a PR with a suggestion? |
Sounds plausible. Most of the problems I think can be fixed by using
In some technical sense, yes... but all build artifacts should still be contained within the build directory. (This matters when you instead create e.g. Also, those are typical "lazy" instructions; not that there is anything wrong with them, but there is no requirement that the build directory be a subdirectory of the source directory. Personally, I keep sources and builds about six levels deep in the FS, with only the first two in common. (When possible, they're on different physical drives, for performance reasons.) IOW, this pattern is just as valid:
|
Do you have a concrete proposal for a change as PR? I'm preparing a new release and now would be a good time to change things. |
Use CMAKE_BINARY_DIR instead of CMAKE_SOURCE_DIR to specify output directories. See OctoMap#133
PR is here: #270 |
It appears that the built libraries get written to the source directory. Please don't do that; build artifacts belong in the build directory.
The text was updated successfully, but these errors were encountered: