I have to create a folder in my target path and copy the header files.

so i used the following command in .pro file

Qt Code:
  1. DESTDIR_WIN_CELLTWEAK = $${CORE_API_PATH}/Include/spgc/
  2. DESTDIR_WIN_CELLTWEAK ~= s,/,\\,g
  3. QMAKE_POST_LINK += $$quote(mkdir $${DESTDIR_WIN_CELLTWEAK} $$escape_expand(\n\t))
  4. for(FILE,EXPORTED_HEADERS_WIN){
  5. QMAKE_POST_LINK +=$$quote(cmd /c copy /y $${FILE} $${DESTDIR_WIN_CELLTWEAK}&$$escape_expand(\n\t))
  6. }
To copy to clipboard, switch view to plain text mode 
it is creating the folder in first time. but on building second i have to avoid creation of spgc folder (as already exist) .

also qt build throws error if spgc folder already exist.

i tried

Qt Code:
  1. !exists($${DESTDIR_WIN_CELLTWEAK})
  2. {
  3. $$quote($${DESTDIR_WIN_CELLTWEAK})
  4. QMAKE_POST_LINK += $$quote(mkdir $${DESTDIR_WIN_CELLTWEAK} $$escape_expand(\n\t))
  5. }
To copy to clipboard, switch view to plain text mode 
but even if the folder present , !exists() function been called and creating the folder.