siegelaaron94 / atom-build-cmake

Generate and build cmake projects from within Atom.
MIT License
6 stars 12 forks source link

being able specify toolchain #38

Closed sancelot closed 5 years ago

sancelot commented 6 years ago

Hi, when generating makefiles, is it possible to specify options like a toolchain ? Each of my cmake projects needs a toolchain for cross compiling. Regards. Steph

siegelaaron94 commented 6 years ago

If you mean CMake toolchain files, then yes you can go to the package settings and add the standard CMake flag to the list of custom CMake arguments e.g. -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain.cmake

RobertWSmith commented 6 years ago

I was considering opening a ticket, but I see @sancelot has a substantially similar issue.

A quick example, the variables CMAKE_BUILD_TYPE, BUILD_TESTING, BUILD_SHARED_LIBS are ones I find myself modifying frequently, and between projects there's no good reason for global consistency between these settings.

I have no idea what the effort involved would be, but would a atom-build style custom configuration file be something that could be supported?

For instance, taking your lib/config.js data and reflowing it as a YAML config file:

# skipped fields should be parsed as using the global default
executable: cmake
cmakelists: ""
cmakeArguments:
  - -DCMAKE_BUILD_TYPE=Release
  - -BUILD_TESTING:BOOL=ON
  - -BUILD_SHARED_LIBS:BOOL=OFF
buildDirectory: $PROJECT_DIR/build
buildArguments:
  - --clean-first
  - arg1
  - arg2
  - argN
parallelBuild: true
siegelaaron94 commented 5 years ago

@RobertWSmith I have added initial support for a configuration file like this in version 0.12.0. However, It is JSON and follows Visual Studio's CMakeSettings.json format.