PDA

View Full Version : make install problem with (back)slashes



brazso
30th June 2010, 15:56
I wish to use "make install" to export files from my built project to an external directory. Inserting INSTALLS to my pro file, target.path works flawlessly, my application executable file is copied there. However inserting my translations rules generates error.

...
INSTALLDIR_WIN32 = ../installer/win32_test
TS_DIR = ../translations
...
win32 {
translations.files = $$TS_DIR/*.qm
translations.path = $${INSTALLDIR_WIN32}/translations
INSTALLS += translations
}
...

...
cp d:\Users\Brazso\work\qmp3gain\translations\qmp3gai n_hu.qm d:/Users/Brazso/work/qmp3gain/src/../installer/win32_test/translations/
cp: cannot create regular file `d:/Users/Brazso/work/qmp3gain/src/../installer/win32_test/translations/d:\\Users\\Brazso\\work\\qmp3gain\\translations\\q mp3gain_hu.qm': No such file or directory
make[2]: [install_translations] Error 1 (ignored)
cp "../bin/qmp3gain.exe" "d:/Users/Brazso/work/qmp3gain/installer/win32_test/qmp3gain.exe"
...
Of course the generated Makefile already contains the backslashes:
...
install_translations: first FORCE
@$(CHK_DIR_EXISTS) d:$(INSTALL_ROOT)/Users/Brazso/work/qmp3gain/src/../installer/win32_test/translations/ || $(MKDIR) d:$(INSTALL_ROOT)/Users/Brazso/work/qmp3gain/src/../installer/win32_test/translations/
-$(INSTALL_FILE) d:\Users\Brazso\work\qmp3gain\translations\qmp3gai n_hu.qm d:$(INSTALL_ROOT)/Users/Brazso/work/qmp3gain/src/../installer/win32_test/translations/
...

I use mingw32(-make) and its cp (copy) command expects slashes in file names, but unfortunately the first (source) parameter contains a filename with backslashes. This first parameter comes from the translations.files setting. It's strange the translations.path appears in unix style but translations.files appears in windows.
How can I use own INSTALLS rules with mingw32?

brazso
1st July 2010, 10:15
This problem is already solved in QT repository:
http://qt.gitorious.org/qt/qt/commit/d36be1232e4f11cf5dc121bb60c628970b88ac2a
My problem is related to the git client placed into the windows path. Installed git client contains sh.exe, and before the afore-mentioned bug patch, qmake generates filenames containing slashes for separation except filenames from (INSTALLS) rule.files inside the Makefile. As a quick solution (until the update of my installed QT), removing git client from the path, the generated Makefile contains backslashes everywhere.