projectile icon indicating copy to clipboard operation
projectile copied to clipboard

projectile-compile-project using build directory automatically

Open nickenchev opened this issue 5 years ago • 4 comments

Issuing projectile-compile-project seems to automatically run my build command from inside my build/ folder. I was expecting this command to execute from within the context of the project root. This isn't necessarily a bad thing as it means I can just use cmake --build . instead of cmake --build build when I setup my build command, but it was confusing and I thought it was a problem with the way projectile is detecting the project root at first.

Emacs 28.0.50 Projectile 2.2.0snapshot

nickenchev avatar May 02 '20 16:05 nickenchev

I think a while ago someone said that using build/ was the standard cmake convention, therefore the current behaviour. I'm not cmake expert, so I can't comment on this. :-)

bbatsov avatar May 02 '20 16:05 bbatsov

I always use build/ so its not really an issue, but there are some tools that prefer out-of-source build directories that are actually siblings to the project root. I guess my point is that I always expect any commands that start with projectile- to use the project root. When this change hit my emacs, I was also in the middle of cleaning up my configuration and thought I messed something up.

Also I don't think there should be anything cmake specific built into projectile-compile-project. I've used this command to also configure an xcodebuild command and an ndk-build command, none of which use cmake. The default for the command should just be cmake --build build, but I don't think the path should change.

nickenchev avatar May 02 '20 16:05 nickenchev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] avatar Oct 31 '20 04:10 stale[bot]

See also https://github.com/bbatsov/projectile/issues/1513#issuecomment-1249638913

Thaodan avatar Sep 16 '22 23:09 Thaodan