How do I specify different include paths for a PrebuiltLibrary on a Native C++ application?

I’m trying to build a multiplatform app, and I’m having trouble getting it to work with PrebuiltLibraries. I have several builds of this same library, each installed in a different directory (named the same as the targetPlatform names). The binary paths seem to work, but the header paths don’t seem to work the same. It makes sense to me why it doesn’t work: binaries and headers are each independent properties of the individual PrebuiltLibraries. When I loop through all binaries.withType… the header paths for each platform are appended to the list of header paths of the other platforms. How can I get the behavior I’m looking for? build.gradle is below:

apply plugin: 'cpp'
model {
    repositories {
        libs(PrebuiltLibraries) {
            SDL2 {
                binaries.withType(StaticLibraryBinary) {
                    def baseDir = "cots/SDL2/installdir/${targetPlatform.name}"
                    headers.srcDir "${baseDir}/include"
                    staticLibraryFile = file("${baseDir}/lib/libSDL2.a")
                }
                binaries.withType(SharedLibraryBinary) {
                    def baseDir = "cots/SDL2/installdir/${targetPlatform.name}"
                    headers.srcDir "${baseDir}/include"
                    sharedLibraryLinkFile = file("${baseDir}/lib/libSDL2main.a")

                    if (targetPlatform.operatingSystem.windows) {
                        sharedLibraryFile = file("${baseDir}/bin/SDL2.dll")
                    } else {
                        sharedLibraryFile = file("${baseDir}/lib/libSDL2.so")
                    }
                }
            }
        }
    }

    buildTypes {
        debug
        release
    }

    toolChains {
        "i686-pc-linux-gnu"(Gcc) {
            target("linux_x86") {
                cppCompiler.withArguments { args ->
                    args << "-m32"
                }
                linker.withArguments { args ->
                    args << "-m32"
                }
            }
        }
        "x86_64-pc-linux-gnu"(Gcc) {
            eachPlatform { tools ->
                tools.cppCompiler.executable = "x86_64-pc-linux-gnu-gcc"
            }
            target("linux_x86-64") {
                cppCompiler.withArguments { args ->
                    args << "-m64"
                }
                linker.withArguments { args ->
                    args << "-m64"
                }
            }
        }
        "i686-w64-mingw32"(Gcc) {
            eachPlatform { tools ->
                tools.cppCompiler.executable = "i686-w64-mingw32-gcc"
            }
            target("windows_x86") {
                cppCompiler.withArguments { args ->
                    args << "-m32"
                }
                linker.withArguments { args ->
                    args << "-m32"
                }
            }
        }
        "x86_64-w64-mingw32"(Gcc) {
            eachPlatform { tools ->
                tools.cppCompiler.executable = "x86_64-w64-mingw32-gcc"
            }
            target("windows_x86-64") {
                cppCompiler.withArguments { args ->
                    args << "-m64"
                }
                linker.withArguments { args ->
                    args << "-m64"
                }
            }
        }
    }

    platforms {
        linux_x86 {
            architecture "x86"
            operatingSystem "linux"
        }
        "linux_x86-64" {
            architecture "x86-64"
            operatingSystem "linux"
        }
        windows_x86 {
            architecture "x86"
            operatingSystem "windows"
        }
        "windows_x86-64" {
            architecture "x86-64"
            operatingSystem "windows"
        }
    }

    flavors {
        community
        enterprise
    }

    components {
        sdl_experiment5(NativeExecutableSpec) {
            targetPlatform "linux_x86"
            targetPlatform "linux_x86-64"
            targetPlatform "windows_x86"
            targetPlatform "windows_x86-64"

            binaries.all {
                sources {
                    cpp.lib library: "SDL2"
                }
            }
        }
    }
}

This certainly isn’t ideal, but I changed the end of my component.sdl_experiment5 closure to look like the following:

    sources {
    cpp.lib library: "SDL2", linkage: "shared"
}

binaries.all { thisbin ->
    if (toolChain in VisualCpp) {
        cppCompiler.args "/I${sdlbaseDir}${targetPlatform.name}/include"
    } else {
        def config_app_path = "${sdlbaseDir}${targetPlatform.name}/bin/sdl2-config";
        if (file(config_app_path).exists()) {
            def proc;
            def outputStream;
            def sdl2configlinkerargs;
            def sdl2configcompilerargs;

            proc = "${config_app_path} --libs".execute();
            outputStream = new StringBuffer();
            proc.waitForProcessOutput(outputStream, System.err)
            sdl2configlinkerargs = outputStream.toString().replaceAll("\n", "").split(" ")

            proc = "${config_app_path} --cflags".execute();
            outputStream = new StringBuffer();
            proc.waitForProcessOutput(outputStream, System.err)
            sdl2configcompilerargs = outputStream.toString().replaceAll("\n", "").split(" ")

            cppCompiler.args sdl2configcompilerargs
            linker.args sdl2configlinkerargs
        }
    }
}