doc/src/snippets/qmake/replacefunction.pro
author Eckhart Koeppen <eckhart.koppen@nokia.com>
Wed, 28 Apr 2010 13:15:16 +0300
branchRCL_3
changeset 15 b25b6dc3ff8b
parent 0 1918ee327afb
permissions -rw-r--r--
2010-17 8b4fb6db9a24f58dafbd4734d9c4a87a72f9ad8f

#! [0]
defineReplace(headersAndSources) {
    variable = $$1
    names = $$eval($$variable)
    headers =
    sources =

    for(name, names) {
        header = $${name}.h
        exists($$header) {
            headers += $$header
        }
        source = $${name}.cpp
        exists($$source) {
            sources += $$source
        }
    }
    return($$headers $$sources)
}
#! [0]

defineReplace(matchingFiles) {
    names = $$ARGS
    files =

    for(name, names) {
        header = $${name}.h
        source = $${name}.cpp
        exists($$header):exists($$source) {
            files += $$header
            files += $$source
        }
    }
    return($$files)
}

names = delegate model view main
message(Finding all headers and sources from the following list of names:)
message($$names)
allFiles = $$headersAndSources(names)
message(Found: $$allFiles)

message(Finding only matching headers and sources from the following list of names:)
message($$names)
matching = $$matchingFiles($$names)
message(Found: $$matching)