AtomBuild / atom-build-make

GNU Make plugin for atom-build
MIT License
13 stars 19 forks source link

Out-of-source builds and (basic) CMake support #12

Closed simfinite closed 8 years ago

simfinite commented 8 years ago

Currently, Makefiles must reside in the project root folder and make is always executed in this folder. It would be a great if we could support out-of-source builds.

For the out-of-source builds, I implemented the following changes:

Out-of-source build support enables to easily support CMake Makefile generation:

This was the first time in a while that I got in touch with Javascript and I had to wrap my head around the concept of Promises to include the additional (and conditional) call to execute CMake before Make. I think, I got it right and it does work, but there is a little TODO marking the section that I would like to have reviewed by someone who knows what he's doing ;). Also, I haven't added any unittests yet, as I'm completely unfamiliar with the atom testing framework.

simfinite commented 8 years ago

Hmm.. just found out that I'm not only not providing tests for the new feature, the changes also let the existing tests fail. I definitely will need some help to sort this out, because with the default configuration (CMake not used, build folder is project folder) nothing should change.

noseglid commented 8 years ago

Hello and thanks for your contribution.

I think CMake support should not be part of this project. I separate build provider for CMake would be in order. There is none at this time, so feel free to become the author! I have written some documentation for this to alleviate the process.

Regarding out-of-source builds. For me it doesn't make sense to have a global configuration for this. Different projects I work on will have different layout so one configuration wouldn't do it. Have you checked out the custom build file replacements if that could solve what you're trying to accomplish?

simfinite commented 8 years ago

I agree that a separate CMake build provider would be the best solution. However, in order to create one I would have to dig into the Atom framework more deeply, which I would love to do if I could find the time... Concerning the global build directory option, maybe that's just a personal thing, but I don't like to add tool-specific (configuration) files into (possibly foreign) projects I'm working with just because I choose to use some esoteric (21st century, hackable) editor/IDE ;) that noone else is using on the project. Now, with the build-make package I can build projects that use GNU Make without adding anything, but the Makefile needs to be in the project root for this to work. With the additions I've proposed, I can build projects that use GNU Make and/or CMake and may also be configured for out-of-source builds. Again that's probably a personal thing, but I would rather reconfigure Atom for the specific project I'm working on than inserting configuration files into foreign projects, which I can't/don't want to add to any VCS and therefore have to take care of on any new checkout anyway. I would like to see Atom as a generic tool that I can adapt non-intrusively to projects I'm working on.

simfinite commented 8 years ago

On second thought maybe the following features could be suited well for the build-make package (and also future CMake providers):

noseglid commented 8 years ago

Working with build providers in different folder of a project is tracked here: https://github.com/noseglid/atom-build/issues/317

I'm certain that I don't want CMake support in this package. Feel free to clone this package and modify to work with CMake and publish it as build-cmake. Follow instruction on the AtomBuild github pages repo to have it listed! I'd be happy to answer any questions you might have on slack!