Modification des options de compilation : pour les dossiers des traductions et de la collection commune, il est desormais possible de specifier des chemins :

* absolus
  * relatifs (au current working directory)
  * relatifs au dossier contenant le binaire executable
... ou tout simplement de ne pas en specifier


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@633 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2009-05-09 19:58:43 +00:00
parent 8633a15bbe
commit dc43d675db
2 changed files with 27 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ win32 {
} }
macx { macx {
# Chemins MacOS X # Chemins MacOS X
COMPIL_PREFIX = '/usr/local/' COMPIL_PREFIX = ''
INSTALL_PREFIX = '/usr/local/' INSTALL_PREFIX = '/usr/local/'
QET_BINARY_PATH = 'bin/' QET_BINARY_PATH = 'bin/'
QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/' QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/'
@@ -309,7 +309,7 @@ unix {
INSTALLS += desktop mime_xml mime_desktop mime_package icons man examples INSTALLS += desktop mime_xml mime_desktop mime_package icons man examples
} }
# Options de compilation propres a Unix # Options de compilation communes a Unix et MacOS X
unix { unix {
# Chemin des fichiers de traduction ; par defaut : lang/ dans le repertoire d'execution # Chemin des fichiers de traduction ; par defaut : lang/ dans le repertoire d'execution
DEFINES += QET_LANG_PATH=$$join(COMPIL_PREFIX,,,$${QET_LANG_PATH}) DEFINES += QET_LANG_PATH=$$join(COMPIL_PREFIX,,,$${QET_LANG_PATH})
@@ -317,3 +317,10 @@ unix {
# Chemin de la collection commune ; par defaut : elements/ dans le repertoire d'execution # Chemin de la collection commune ; par defaut : elements/ dans le repertoire d'execution
DEFINES += QET_COMMON_COLLECTION_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_COLLECTION_PATH}) DEFINES += QET_COMMON_COLLECTION_PATH=$$join(COMPIL_PREFIX,,,$${QET_COMMON_COLLECTION_PATH})
} }
# Options de compilation specifiques a MacOS X
macx {
# les chemins definis precedemment sont relatifs au dossier contenant le binaire executable
DEFINES += QET_LANG_PATH_RELATIVE_TO_BINARY_PATH
DEFINES += QET_COMMON_COLLECTION_PATH_RELATIVE_TO_BINARY_PATH
}

View File

@@ -264,10 +264,17 @@ QString QETApp::commonElementsDir() {
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION #ifdef QET_ALLOW_OVERRIDE_CED_OPTION
if (common_elements_dir != QString()) return(common_elements_dir); if (common_elements_dir != QString()) return(common_elements_dir);
#endif #endif
#ifdef QET_COMMON_COLLECTION_PATH #ifndef QET_COMMON_COLLECTION_PATH
return(QUOTE(QET_COMMON_COLLECTION_PATH)); // en l'absence d'option de compilation, on utilise le dossier elements, situe a cote du binaire executable
#else
return(QCoreApplication::applicationDirPath() + "/elements/"); return(QCoreApplication::applicationDirPath() + "/elements/");
#else
#ifndef QET_COMMON_COLLECTION_PATH_RELATIVE_TO_BINARY_PATH
// l'option de compilation represente un chemin absolu ou relatif classique
return(QUOTE(QET_COMMON_COLLECTION_PATH));
#else
// l'option de compilation represente un chemin relatif au dossier contenant le binaire executable
return(QCoreApplication::applicationDirPath() + "/" + QUOTE(QET_COMMON_COLLECTION_PATH)));
#endif
#endif #endif
} }
@@ -412,9 +419,16 @@ QString QETApp::languagesPath() {
return(lang_dir); return(lang_dir);
} else { } else {
#ifndef QET_LANG_PATH #ifndef QET_LANG_PATH
// en l'absence d'option de compilation, on utilise le dossier lang, situe a cote du binaire executable
return(QCoreApplication::applicationDirPath() + "/lang/"); return(QCoreApplication::applicationDirPath() + "/lang/");
#else #else
return(QUOTE(QET_LANG_PATH)); #ifndef QET_LANG_PATH_RELATIVE_TO_BINARY_PATH
// l'option de compilation represente un chemin absolu ou relatif classique
return(QUOTE(QET_LANG_PATH));
#else
// l'option de compilation represente un chemin relatif au dossier contenant le binaire executable
return(QCoreApplication::applicationDirPath() + "/" + QUOTE(QET_LANG_PATH)));
#endif
#endif #endif
} }
} }