diff --git a/qucs/config.h.cmake b/qucs/config.h.cmake index 567ddb1e4a..cab35aebfb 100755 --- a/qucs/config.h.cmake +++ b/qucs/config.h.cmake @@ -1,5 +1,3 @@ -#cmakedefine LANGUAGEDIR "@LANGUAGEDIR@" -#cmakedefine LIBRARYDIR "@LIBRARYDIR@" #define PACKAGE_VERSION "@PROJECT_VERSION@" #define PACKAGE_STRING "qucs @PROJECT_VERSION@" diff --git a/qucs/configure.ac b/qucs/configure.ac index 99d045cb51..3f6c8265e0 100644 --- a/qucs/configure.ac +++ b/qucs/configure.ac @@ -764,16 +764,6 @@ mingw* | *msys* | cygwin*) esac AC_SUBST(PATHXFORM) -dnl Create path info. -LANG_PATH="$prefix/share/qucs/lang/" -AC_DEFINE_UNQUOTED([LANGUAGEDIR], ["$LANG_PATH"], - [Where the language files go.]) -unset LANG_PATH -LIBRARY_PATH="$prefix/share/qucs/library/" -AC_DEFINE_UNQUOTED([LIBRARYDIR], ["$LIBRARY_PATH"], - [Where the component library files go.]) -unset LIBRARY_PATH - dnl Definitions at top of . AH_TOP([ /* __BEGIN_DECLS should be used at the beginning of your declarations, diff --git a/qucs/qucs-activefilter/CMakeLists.txt b/qucs/qucs-activefilter/CMakeLists.txt index 913cb9ecde..12a06494a1 100644 --- a/qucs/qucs-activefilter/CMakeLists.txt +++ b/qucs/qucs-activefilter/CMakeLists.txt @@ -25,9 +25,6 @@ IF(NOT WIN32) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register ") ENDIF() -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - #configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-activefilter/main.cpp b/qucs/qucs-activefilter/main.cpp index 73bd67da87..6f81a2e1aa 100644 --- a/qucs/qucs-activefilter/main.cpp +++ b/qucs/qucs-activefilter/main.cpp @@ -63,7 +63,7 @@ bool saveApplSettings(QucsActiveFilter *qucs) int main(int argc, char *argv[]) { - QString LangDir; + QString LangDir; // apply default settings QucsSettings.x = 200; QucsSettings.y = 100; @@ -72,13 +72,21 @@ int main(int argc, char *argv[]) // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-attenuator/CMakeLists.txt b/qucs/qucs-attenuator/CMakeLists.txt index 49b56bee1e..3466ebacf5 100644 --- a/qucs/qucs-attenuator/CMakeLists.txt +++ b/qucs/qucs-attenuator/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-attenuator/main.cpp b/qucs/qucs-attenuator/main.cpp index c431107a6e..bec266af82 100644 --- a/qucs/qucs-attenuator/main.cpp +++ b/qucs/qucs-attenuator/main.cpp @@ -71,13 +71,21 @@ int main( int argc, char ** argv ) // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); QucsSettings.LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-edit/CMakeLists.txt b/qucs/qucs-edit/CMakeLists.txt index b5bdddcb0e..4d24714dda 100644 --- a/qucs/qucs-edit/CMakeLists.txt +++ b/qucs/qucs-edit/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-edit/main.cpp b/qucs/qucs-edit/main.cpp index 7d5ed91219..a441d318ae 100644 --- a/qucs/qucs-edit/main.cpp +++ b/qucs/qucs-edit/main.cpp @@ -99,13 +99,21 @@ int main(int argc, char *argv[]) // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); QucsSettings.LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-filter-v2/CMakeLists.txt b/qucs/qucs-filter-v2/CMakeLists.txt index efdb441434..9f90cb4bba 100644 --- a/qucs/qucs-filter-v2/CMakeLists.txt +++ b/qucs/qucs-filter-v2/CMakeLists.txt @@ -2,8 +2,6 @@ PROJECT(qucsfilter-v2 CXX C) CMAKE_MINIMUM_REQUIRED(VERSION 2.6) cmake_policy(VERSION 2.6) -SET(LANGUAGEDIR TRUE) - SET(CMAKE_BUILD_TYPE Debug) # The incomplete filter-v2 only builds withs -stdlib=libstc++ diff --git a/qucs/qucs-filter-v2/qf_main.cpp b/qucs/qucs-filter-v2/qf_main.cpp index cd035d9f74..a7bcf4e989 100644 --- a/qucs/qucs-filter-v2/qf_main.cpp +++ b/qucs/qucs-filter-v2/qf_main.cpp @@ -41,13 +41,21 @@ int main (int argc, char * argv []) { // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); QucsSettings.LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-filter/CMakeLists.txt b/qucs/qucs-filter/CMakeLists.txt index d8fe16cacf..c725fcc57e 100644 --- a/qucs/qucs-filter/CMakeLists.txt +++ b/qucs/qucs-filter/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-filter/main.cpp b/qucs/qucs-filter/main.cpp index a8748b960a..69847e35e2 100644 --- a/qucs/qucs-filter/main.cpp +++ b/qucs/qucs-filter/main.cpp @@ -84,13 +84,21 @@ int main(int argc, char *argv[]) // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); QucsSettings.LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-help/CMakeLists.txt b/qucs/qucs-help/CMakeLists.txt index cf6fcca7c0..92fc529294 100644 --- a/qucs/qucs-help/CMakeLists.txt +++ b/qucs/qucs-help/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-lib/CMakeLists.txt b/qucs/qucs-lib/CMakeLists.txt index 583b32b4c7..98101feb9b 100644 --- a/qucs/qucs-lib/CMakeLists.txt +++ b/qucs/qucs-lib/CMakeLists.txt @@ -17,10 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") -SET(LIBRARYDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/library/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-lib/main.cpp b/qucs/qucs-lib/main.cpp index c78181db34..499ca379b9 100644 --- a/qucs/qucs-lib/main.cpp +++ b/qucs/qucs-lib/main.cpp @@ -100,8 +100,15 @@ int main(int argc, char *argv[]) QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/"; } else { - QucsSettings.LangDir = LANGUAGEDIR; - QucsSettings.LibDir = LIBRARYDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; + QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/qucs/library/"; } loadSettings(); diff --git a/qucs/qucs-rescodes/CMakeLists.txt b/qucs/qucs-rescodes/CMakeLists.txt index c508590ef6..e62d21f3f4 100644 --- a/qucs/qucs-rescodes/CMakeLists.txt +++ b/qucs/qucs-rescodes/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-rescodes/main.cpp b/qucs/qucs-rescodes/main.cpp index 87a36327bd..a5fd6b29c6 100644 --- a/qucs/qucs-rescodes/main.cpp +++ b/qucs/qucs-rescodes/main.cpp @@ -235,7 +235,14 @@ int main( int argc, char **argv ) QucsDir = QDir(QString(var)); QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } loadSettings(); diff --git a/qucs/qucs-transcalc/CMakeLists.txt b/qucs/qucs-transcalc/CMakeLists.txt index c306077163..b3410c942a 100644 --- a/qucs/qucs-transcalc/CMakeLists.txt +++ b/qucs/qucs-transcalc/CMakeLists.txt @@ -17,9 +17,6 @@ SET(CMAKE_BUILD_TYPE Debug) ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # configure the header config.h CONFIGURE_FILE ( "${PROJECT_SOURCE_DIR}/../config.h.cmake" diff --git a/qucs/qucs-transcalc/main.cpp b/qucs/qucs-transcalc/main.cpp index 52479579cb..cbe2138939 100644 --- a/qucs/qucs-transcalc/main.cpp +++ b/qucs/qucs-transcalc/main.cpp @@ -105,13 +105,21 @@ int main(int argc, char *argv[]) // is application relocated? char * var = getenv ("QUCSDIR"); + QDir QucsDir; if (var != NULL) { - QDir QucsDir = QDir (var); + QucsDir = QDir (var); QString QucsDirStr = QucsDir.canonicalPath (); QucsSettings.LangDir = QDir::convertSeparators (QucsDirStr + "/share/qucs/lang/"); } else { - QucsSettings.LangDir = LANGUAGEDIR; + QString QucsApplicationPath = QCoreApplication::applicationDirPath(); +#ifdef __APPLE__ + QucsDir = QDir(QucsApplicationPath.section("/bin",0,0)); +#else + QucsDir = QDir(QucsApplicationPath); + QucsDir.cdUp(); +#endif + QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/qucs/lang/"; } QucsSettings.QucsWorkDir.setPath (QDir::homePath()+QDir::convertSeparators ("/.qucs")); loadSettings(); diff --git a/qucs/qucs/CMakeLists.txt b/qucs/qucs/CMakeLists.txt index 2bb0e859c3..58cb5fec7e 100755 --- a/qucs/qucs/CMakeLists.txt +++ b/qucs/qucs/CMakeLists.txt @@ -54,10 +54,6 @@ endif() # ADD_DEFINITIONS( -DHAVE_CONFIG_H ) -# define variables -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - - FIND_PACKAGE( Qt4 4.6.3 REQUIRED QtCore QtGui Qt3Support QtSvg QtXml QtScript) INCLUDE( ${QT_USE_FILE} ) diff --git a/qucs/translations/CMakeLists.txt b/qucs/translations/CMakeLists.txt index 6be103eb56..3c5396e52a 100644 --- a/qucs/translations/CMakeLists.txt +++ b/qucs/translations/CMakeLists.txt @@ -31,13 +31,9 @@ ENDIF (UPDATE_TRANSLATIONS) # #FILE(GLOB QtTRANSLATIONS qtgeneric_*.ts) -# -# location for translations -SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/") - # # install tranlations -INSTALL( FILES ${QM_FILES} DESTINATION ${LANGUAGEDIR}) +INSTALL( FILES ${QM_FILES} DESTINATION share/qucs/lang) # prevent the generated files from being deleted during make clean #set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)