CDT plugin is not creating a proper project


(Jeroen Lankheet) #1

Hi,

I would like to know what the status of the Cpp and especially CDT support in Gradle is. I have trouble finding any leads about this topic.

I’m trying hard to get a cpp-Qt program Elcipsified. But it seems the CDT plugin can only provide one configuration. A hello world program works fine, but adding dependencies to Qt include dirs and libs is less fine.

apply plugin: 'cpp'
apply plugin: 'eclipse'
//apply plugin: 'eclipse-cdt'
  executables {
    main {
        binaries.all {
            // Define a preprocessor macro
            cppCompiler.define "NDEBUG"
            // Add some additional compiler arguments
            if (toolChain in Gcc) {
                cppCompiler.args "-fno-access-control", "-fconserve-space",
                 "-I/usr/include",
                "-I/usr/lib64/qt4/mkspecs/linux-g++",
                "-I/usr/include/QtCore",
                 "-I/usr/include/QtGui"
                linker.args "-L/usr/lib64", "-lQtCore", "-lQtGui", "-lpthread"
            }
        }
    }
}

Funny thing is that i was able to generate a working configuration with the eclipse plugin, only once!

How can I create a CDT config for this gradle project?

Thanks, Jeroen.