Commits

Vincent Rabeux committed 5518de6

Fixed installation phase on Ubuntu.

Comments (0)

Files changed (4)

documentImageCreator/src/gui/AncientDocumentEditor/CMakeLists.txt

 	src/*.ui
 )
 
+set(install true)
 
+if(NOT install)
 set(fontfolder ../../../../font/)
 set(backgroundfolder ../../../../background/)
 set(xmlcheckerfolder ../../../../xmlchecker/)
 set(formatsfolder ../../../../keyboard/)
+endif()
+
+
+if(install)
+set(fontfolder ../../../font/)
+set(backgroundfolder ../../../background/)
+set(xmlcheckerfolder ../../../xmlchecker/)
+set(formatsfolder ../../../keyboard/)
+
+set(installfontfolder ${CMAKE_INSTALL_PREFIX}/share/AncientDocumentEditor/font/)
+set(installbackgroundfolder ${CMAKE_INSTALL_PREFIX}/share/AncientDocumentEditor/background/)
+set(installxmlcheckerfolder ${CMAKE_INSTALL_PREFIX}/share/AncientDocumentEditor/xmlchecker/)
+set(installformatsfolder ${CMAKE_INSTALL_PREFIX}/share/AncientDocumentEditor/keyboard/)
+
+install (DIRECTORY ${fontfolder} DESTINATION  share/AncientDocumentEditor/font)
+install (DIRECTORY ${backgroundfolder} DESTINATION share/AncientDocumentEditor/background)
+install (DIRECTORY ${xmlcheckerfolder} DESTINATION share/AncientDocumentEditor/xmlchecker)
+install (DIRECTORY ${formatsfolder} DESTINATION share/AncientDocumentEditor/keyboard)
+
+endif()
 
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/application.ini.in
                ${CMAKE_CURRENT_SOURCE_DIR}/src/application.ini

documentImageCreator/src/gui/AncientDocumentEditor/application.ini.in

 [mainapp]
 
-fontfolder=@fontfolder@
-backgroundfolder=@backgroundfolder@
-xmlcheckerfolder=@xmlcheckerfolder@
+fontfolder=@installfontfolder@
+backgroundfolder=@installbackgroundfolder@
+xmlcheckerfolder=@installxmlcheckerfolder@
 documentxsdchecker=document.xsd
 defaultfont=vesale 
 defaultfontextension=.of
 pagesizey=1782
 
 [keyboard]
-formatsfolder=@formatsfolder@
+formatsfolder=@installformatsfolder@
 defaultformat=fr_alternative.kb

documentImageCreator/src/gui/AncientDocumentEditor/src/ancientdocumenteditor.cpp

     _firstStart = true;
 
     // Initialize font context
-    QString fontpath = qApp->applicationDirPath()+"/"+ConfigurationManager::get(AppConfigMainGroup,AppConfigFontFolderKey).toString()  ;
+    QString fontpath = ConfigurationManager::get(AppConfigMainGroup,AppConfigFontFolderKey).toString()  ;
     QString fontext = ConfigurationManager::get(AppConfigMainGroup,AppConfigFontExtKey).toString();
 
     qDebug() << "FontContext::initialize  : path =" << fontpath << "fileextention : " << fontext;
     FontContext::initialize(fontpath, fontext);
     FontContext::instance()->setCurrentFont(ConfigurationManager::get(AppConfigMainGroup, AppConfigDefaultFontKey).toString());
 
-    QString backgroundpath = qApp->applicationDirPath()+"/"+ConfigurationManager::get(AppConfigMainGroup,AppConfigBackgdFolderKey).toString();
+    QString backgroundpath = ConfigurationManager::get(AppConfigMainGroup,AppConfigBackgdFolderKey).toString();
     BackgroundContext::initialize(backgroundpath);
     BackgroundContext::instance()->setCurrentBackground(ConfigurationManager::get(AppConfigMainGroup, AppConfigDefaultBackbg).toString());
 
-    _keyboard = qApp->applicationDirPath()+"/"+ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbFolderKey).toString()
+    _keyboard = ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbFolderKey).toString()
 		+ ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbDefautlFormatKey).toString();
     qDebug() << _keyboard;
 
     _documentView = new DocumentView(_docController);
     _docPropertiesView = new DocumentPropertiesView(_docController);
 
-    QString keyboardPath = qApp->applicationDirPath()+"/"+ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbFolderKey).toString() + ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbDefautlFormatKey).toString() ;
+    QString keyboardPath = ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbFolderKey).toString() + ConfigurationManager::get(AppConfigKeyBoardGroup, AppConfigKbDefautlFormatKey).toString() ;
     KeyboardViewDirector kbvDirector( new KeyboardViewXmlBuilder( keyboardPath ) );
     kbvDirector.constructKeyboardView();
     _keyboardView = kbvDirector.getKeyboardView();

documentImageCreator/src/gui/AncientDocumentEditor/src/application.ini

 [mainapp]
 
-fontfolder=../../../../font/
-backgroundfolder=../../../../background/
-xmlcheckerfolder=../../../../xmlchecker/
+fontfolder=/usr/local/share/AncientDocumentEditor/font/
+backgroundfolder=/usr/local/share/AncientDocumentEditor/background/
+xmlcheckerfolder=/usr/local/share/AncientDocumentEditor/xmlchecker/
 documentxsdchecker=document.xsd
 defaultfont=vesale 
 defaultfontextension=.of
 pagesizey=1782
 
 [keyboard]
-formatsfolder=../../../../keyboard/
+formatsfolder=/usr/local/share/AncientDocumentEditor/keyboard/
 defaultformat=fr_alternative.kb