cleaned up qmake project file, improved mac app bundle generation
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@161 b624d157-de02-0410-bad0-e51aec6abb33
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
26
src/main.cpp
|
@ -70,6 +70,7 @@ QHash<QString,QIcon*>IconCache;
|
|||
KpxConfig *config;
|
||||
QString AppDir;
|
||||
QString HomeDir;
|
||||
QString DataDir;
|
||||
QString PluginLoadError;
|
||||
bool TrActive;
|
||||
QString DetailViewTemplate;
|
||||
|
@ -97,6 +98,12 @@ int main(int argc, char **_argv)
|
|||
#else
|
||||
HomeDir = QDir::homePath()+"/.keepassx";
|
||||
#endif
|
||||
|
||||
#if defined Q_WS_MACX
|
||||
DataDir=AppDir+"/../Resources/keepassx";
|
||||
#else
|
||||
DataDir=AppDir+"/../share/keepassx";
|
||||
#endif
|
||||
bool ArgMin = false;
|
||||
bool ArgLock = false;
|
||||
parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock);
|
||||
|
@ -182,8 +189,7 @@ int main(int argc, char **_argv)
|
|||
qtTranslator=new QTranslator;
|
||||
|
||||
if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
|
||||
<< AppDir+"/../share/keepass/i18n/"
|
||||
<< AppDir+"/share/i18n/"
|
||||
<< DataDir+"/i18n/"
|
||||
<< HomeDir))
|
||||
{
|
||||
app->installTranslator(translator);
|
||||
|
@ -201,8 +207,7 @@ int main(int argc, char **_argv)
|
|||
if(TrActive){
|
||||
if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
|
||||
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
|
||||
<< AppDir+"/../share/keepass/i18n/"
|
||||
<< AppDir+"/share/i18n/"
|
||||
<< DataDir+"/i18n/"
|
||||
<< HomeDir))
|
||||
app->installTranslator(qtTranslator);
|
||||
else{
|
||||
|
@ -321,10 +326,8 @@ void openBrowser(const QString& UrlString){
|
|||
}
|
||||
|
||||
QString getImageFile(const QString& name){
|
||||
if (QFile::exists(AppDir+"/../share/keepass/icons/"+name))
|
||||
return AppDir+"/../share/keepass/icons/"+name;
|
||||
else if (QFile::exists(AppDir+"/share/icons/"+name))
|
||||
return AppDir+"/share/icons/"+name;
|
||||
if (QFile::exists(DataDir+"/icons/"+name))
|
||||
return DataDir+"/icons/"+name;
|
||||
else{
|
||||
QMessageBox::critical(0,QApplication::translate("Main","Error"),
|
||||
QApplication::translate("Main","File '%1' could not be found.")
|
||||
|
@ -501,12 +504,13 @@ QString applicationFilePath()
|
|||
});
|
||||
|
||||
return filePath.filePath();
|
||||
#elif defined(Q_WS_MAC)
|
||||
|
||||
#elif defined(Q_WS_MAC)
|
||||
|
||||
CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
|
||||
assert(bundleURL);
|
||||
//assert(bundleURL);
|
||||
CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
|
||||
assert(cfPath);
|
||||
//assert(cfPath);
|
||||
CFIndex length = CFStringGetLength(cfPath);
|
||||
const UniChar *chars = CFStringGetCharactersPtr(cfPath);
|
||||
if (chars)
|
||||
|
|
|
@ -61,6 +61,7 @@ extern QString PluginLoadError;
|
|||
extern KpxConfig *config;
|
||||
extern QString AppDir;
|
||||
extern QString HomeDir;
|
||||
extern QString DataDir;
|
||||
extern bool TrActive;
|
||||
extern QString DetailViewTemplate;
|
||||
extern QPixmap *EntryIcons;
|
||||
|
|
96
src/src.pro
|
@ -1,35 +1,34 @@
|
|||
|
||||
DEPENDPATH += crypto \
|
||||
dialogs \
|
||||
export \
|
||||
forms \
|
||||
import \
|
||||
lib \
|
||||
translations \
|
||||
res
|
||||
CONFIG = qt uic resources thread stl warn_off release
|
||||
QT += xml
|
||||
|
||||
win32:QMAKE_WIN32 = 1
|
||||
DEPENDPATH += crypto dialogs export forms import lib translations res
|
||||
INCLUDEPATH += . lib crypto plugins/interfaces export import dialogs
|
||||
|
||||
MOC_DIR = ../build/moc
|
||||
UI_DIR = ../build/ui
|
||||
OBJECTS_DIR = ../build
|
||||
RCC_DIR = ../build/rcc
|
||||
|
||||
INSTALLS += target data
|
||||
data.files += ../share/keepass/*
|
||||
TARGET = ../bin/keepassx
|
||||
isEqual(DEBUG,1) {
|
||||
CONFIG += debug
|
||||
}
|
||||
|
||||
unix : !macx : !isEqual(QMAKE_WIN32,1) {
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Platform Specific: Unix (except MacOS X)
|
||||
#-------------------------------------------------------------------------------
|
||||
unix : !macx {
|
||||
isEmpty(PREFIX):PREFIX = /usr
|
||||
|
||||
!isEqual(AUTOTYPE,0) {
|
||||
DEFINES += AUTOTYPE
|
||||
!isEqual(GLOBAL_AUTOTYPE,0) {
|
||||
DEFINES += GLOBAL_AUTOTYPE
|
||||
}
|
||||
}
|
||||
target.path = $${PREFIX}/bin
|
||||
data.path = $${PREFIX}/share/keepass
|
||||
TARGET = ../bin/keepassx
|
||||
TARGET.path = $${PREFIX}/bin
|
||||
data.path = $${PREFIX}/share
|
||||
pixmaps.files = ../share/pixmaps/*
|
||||
pixmaps.path = $${PREFIX}/share/pixmaps
|
||||
desktop.files = ../share/applications/*
|
||||
|
@ -44,30 +43,58 @@ unix : !macx : !isEqual(QMAKE_WIN32,1) {
|
|||
SOURCES += Application_X11.cpp
|
||||
HEADERS += Application_X11.h
|
||||
}
|
||||
isEqual(BUILD_FOR_LSB,1) {
|
||||
QMAKE_CXX = lsbcc
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Platform Specific: MacOS X
|
||||
#-------------------------------------------------------------------------------
|
||||
macx {
|
||||
isEmpty(PREFIX):PREFIX = /Applications
|
||||
target.path = $${PREFIX}
|
||||
data.path = $${PREFIX}/keepassx.app/Contents/share/keepass
|
||||
TARGET = ../bin/KeePassX
|
||||
TARGET.path = $${PREFIX}
|
||||
data.path = Contents/Resources
|
||||
isEmpty(QT_FRAMEWORK_DIR) : QT_FRAMEWORK_DIR = /Library/Frameworks
|
||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtCore.framework
|
||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtGui.framework
|
||||
private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtXml.framework
|
||||
private_frameworks.path = Contents/Frameworks
|
||||
QMAKE_BUNDLE_DATA += data private_frameworks
|
||||
LIBS += -framework CoreFoundation
|
||||
ICON = ../share/macx_bundle/icon.icns
|
||||
CONFIG += app_bundle
|
||||
isEqual(ARCH,UNIVERSAL) : CONFIG += x86 ppc
|
||||
isEqual(ARCH,INTEL) : CONFIG += x86
|
||||
isEqual(ARCH,PPC) : CONFIG += ppc
|
||||
}
|
||||
|
||||
isEqual(QMAKE_WIN32,1) {
|
||||
#-------------------------------------------------------------------------------
|
||||
# Platform Specific: Windows
|
||||
#-------------------------------------------------------------------------------
|
||||
win32 {
|
||||
CONFIG += windows
|
||||
isEmpty(PREFIX):PREFIX = "C:/Program files/KeePassX"
|
||||
|
||||
target.path = $${PREFIX}
|
||||
TARGET = ../bin/KeePassX
|
||||
TARGET.path = $${PREFIX}
|
||||
data.path = $${PREFIX}/share
|
||||
RC_FILE = ../share/ico/keepassx.rc
|
||||
QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
|
||||
}
|
||||
|
||||
|
||||
data.files += ../share/keepassx
|
||||
INSTALLS += TARGET data
|
||||
|
||||
contains(DEFINES,GLOBAL_AUTOTYPE) {
|
||||
FORMS += forms/AutoTypeDlg.ui
|
||||
HEADERS += dialogs/AutoTypeDlg.h
|
||||
SOURCES += dialogs/AutoTypeDlg.cpp
|
||||
}
|
||||
|
||||
|
||||
FORMS += forms/EditGroupDlg.ui \
|
||||
forms/SearchDlg.ui \
|
||||
forms/AboutDlg.ui \
|
||||
|
@ -210,30 +237,3 @@ SOURCES += lib/UrlLabel.cpp \
|
|||
dialogs/ManageBookmarksDlg.cpp
|
||||
|
||||
RESOURCES += res/resources.qrc
|
||||
CONFIG = qt \
|
||||
uic \
|
||||
resources \
|
||||
thread \
|
||||
stl \
|
||||
warn_off
|
||||
QT += xml
|
||||
TEMPLATE = app
|
||||
INCLUDEPATH += . \
|
||||
lib \
|
||||
crypto \
|
||||
plugins/interfaces \
|
||||
export \
|
||||
import \
|
||||
dialogs \
|
||||
./
|
||||
|
||||
isEqual(RELEASE,1) {
|
||||
CONFIG += release
|
||||
}
|
||||
else {
|
||||
CONFIG += debug
|
||||
}
|
||||
|
||||
isEqual(QMAKE_WIN32,1) {
|
||||
CONFIG += windows
|
||||
}
|
||||
|
|