tomtzook / gradle-cmake

A Gradle integration plugin for CMake
6 stars 3 forks source link

Specify CMake generator possible? #1

Closed dwang-hingehealth closed 1 year ago

dwang-hingehealth commented 1 year ago

Hi,

Is there a way to pass an arbitrary command line argument to CMake? What I would like to do is something like cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=path/to/toolchain.cmake ... I'can't find how to pass -G Xcode along.

Thanks!

tomtzook commented 1 year ago

At the moment, no. But it should be a simple change to allow support. Will update as soon as I can.

tomtzook commented 1 year ago

Added feature in #3

tomtzook commented 1 year ago

Published version 1.1.0.

Use

cmake {
    targets {
        example_project {
            cmakeLists.set(file('src/CMakeLists.txt'))
            targetMachines.add(machines.host)
            generator.set("Xcode")
        }
    }
}