diff --git a/CMakeLists.txt b/CMakeLists.txt index bbbf737..6599e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,6 @@ endif(WIN32 OR BUILDBOT) find_package(QScintilla REQUIRED) find_package(QtScriptTools REQUIRED) -CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h ) - file(GLOB jobjol "${CMAKE_SOURCE_DIR}/share/qtlobby/icons/jobjol/?*.*") install(FILES ${jobjol} DESTINATION share/qtlobby/icons/jobjol) file(GLOB trolltech "${CMAKE_SOURCE_DIR}/share/qtlobby/icons/trolltech/?*.*") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b4aed6..f2195da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ include(${QT_USE_FILE}) include_directories(${QTSCRIPTTOOLS_INCLUDE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) # source files set(qtlobby_SRCS @@ -103,8 +104,7 @@ Channel.h ChannelTextBrowser.h CommandAssigner.h Command.h -CompletionListWidget.h -config.h +CompletionListWidget.h ConnectionWidget.h Downloader.h DownloadsDialog.h diff --git a/src/config.h.cmake b/src/config.h.cmake index cca8f35..e643125 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -1,6 +1,7 @@ #ifndef CONFIG_H_ #define CONFIG_H_ +#cmakedefine CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #cmakedefine QTLOBBY_VERSION "@QTLOBBY_VERSION@" #cmakedefine SVN_REV "@SVN_REV@" #cmakedefine PURE_WINAPI_UNITSYNC_LOADER diff --git a/src/main.cpp b/src/main.cpp index 3a49d75..fa092f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,16 +33,16 @@ int main( int argc, char *argv[] ) { #endif QApplication app( argc, argv ); QStringList args = app.arguments(); - QStringList list = args.at(0).split(QDir::separator()); - list.removeLast(); #ifndef Q_WS_WIN - list.removeLast();//windows does not have bin folder, so no need to get one level higher + PathManager::getInstance()->setResourceRoot(QString(CMAKE_INSTALL_PREFIX)+"/share/qtlobby/"); #else + QStringList list = args.at(0).split(QDir::separator()); + list.removeLast(); QCoreApplication::addLibraryPath(list.join(QDir::separator())+QDir::separator()+"qt"); -#endif list.append("share"); list.append("qtlobby"); PathManager::getInstance()->setResourceRoot(list.join(QDir::separator())+QDir::separator()); +#endif for(int i = 1; i < args.size(); i++) { if(args.at(i) == "--3dpreview" || args.at(i) == "-3d") { i++;