lukka / run-cmake

GitHub Action to build C++ applications with CMake (CMakePresets.json), Ninja and vcpkg on GitHub.
MIT License
173 stars 19 forks source link

How to provide `-D` arguments/defined vars? - `cmakeAppendedArgs: '-DVAR=1'` fails #48

Closed SamuelMarks closed 2 years ago

SamuelMarks commented 3 years ago

Attempt:

with:
    cmakeGenerator: 'Ninja'
    cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
    cmakeAppendedArgs: '-DSTANDALONE_MODE=1'

https://github.com/SamuelMarks/premiere-pro-cmake-plugin/actions/runs/1040412150

Or does it not work in CMakeListsTxtBasic?

lukka commented 3 years ago

@SamuelMarks right, it is not used in CMakeListsTxtBasic. It is stated in the description of the input..

I think it would make sense and to simplify the action to have just one mode (i.e. the "advanced" one), and to provide samples with CMake Presets, which is really a cool feature that helps parity of build on CI and locally on your devbox.

lukka commented 2 years ago

Hopefully this is possible with CMakePreset.json. Please take a look to run-cmake@v10 and see if CMakePreset.json suites your needs.