Gradle + Cinder


#1

Hi,

Has anyone got a empty cinder project building with Gradle yet?

I am trying to automate my build process using Gradle but run into alot of linker errors.

Appreciate any help from people that have got this working already.

Here is my gradle build script…

apply plugin: 'cpp' 

model { 

buildTypes {
    debug
    release
}

platforms {

    //osx_64 {
        //architecture "x86_64"
        //operatingSystem "osx"
    //}

    windows_x86 {
        architecture "x86"
        operatingSystem "windows"
    }

    windows_64 {
        architecture "x86_64"
        operatingSystem "windows"
    }
}

repositories {
    libs(PrebuiltLibraries) { 
        libcinder { 
            headers.srcDir "/../cinder/include/" 
            binaries.withType(StaticLibraryBinary) {
                if (targetPlatform.operatingSystem.windows) {
                    if (targetPlatform == platforms.windows_x86) {
                        if(buildType == buildTypes.debug) {
                            staticLibraryFile = file("/../cinder/lib/msw/x86/Debug/v140/cinder.lib") 
                        } else if(buildType == buildTypes.release) {
                            staticLibraryFile = file("/../cinder/lib/msw/x86/Release/v140/cinder.lib") 
                        }
                    } else if(targetPlatform == platforms.windows_64) {
                        if(buildType == buildTypes.debug) {
                            staticLibraryFile = file("/../cinder/lib/msw/x64/Debug/v140/cinder.lib") 
                        } else if(buildType == buildTypes.release) {
                            staticLibraryFile = file("/../cinder/lib/msw/x64/Release/v140/cinder.lib") 
                        }
                    } 
                } //else if(targetPlatform.operatingSystem.o osx) {
                    //if (targetPlatform == platforms.osx_64) {
                        //if(buildType == buildTypes.debug) {
                            //staticLibraryFile = file("/../cinder/lib/macosx/Debug/libcinder.a") 
                        //} else if(buildType == buildTypes.release) {
                            //staticLibraryFile = file("/../cinder/lib/macosx/Release/libcinder.a") 
                        //}
                    //}
                //}
            }
        }
    }
}

components {
    main(NativeExecutableSpec) {
        sources {
            cpp {
                source {
                    srcDirs = [
                         "src",
                         "include"
                     ]
                   
                    //include "include"
                    cpp.lib library: "libcinder", linkage: "static" 
                }
            }
        }
    }
}
}