]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.cpp
Cmake build: Omit also hidden header files from globbing
[lyx.git] / src / support / Package.cpp
index 2e2aebd2f7a326edb178c6afa4199ff50004bb0c..b4b0e1493df7d9f16965eb7c6567979d06f1602a 100644 (file)
@@ -138,11 +138,6 @@ Package::Package(string const & command_line_arg0,
        explicit_user_support_dir_ = userSupportDir(default_user_support_dir,
                                     command_line_user_support_dir, user_support_dir_);
 
-       FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
-       configure_command_ = os::python() + ' ' +
-                       quoteName(configure_script.toFilesystemEncoding(), quote_python) +
-                       with_version_suffix() + " --binary-dir=" +
-                       quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());
 
        LYXERR(Debug::INIT, "<package>\n"
                << "\tbinary_dir " << binary_dir().absFileName() << '\n'
@@ -156,6 +151,18 @@ Package::Package(string const & command_line_arg0,
                << "</package>\n");
 }
 
+std::string const & Package::configure_command() const
+{
+       if (configure_command_.empty()) {
+               FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
+               configure_command_ = os::python() + ' ' +
+                       quoteName(configure_script.toFilesystemEncoding()) +
+                       with_version_suffix() + " --binary-dir=" +
+                       quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding());
+       }
+       return configure_command_;
+}
+
 
 void Package::set_temp_dir(FileName const & temp_dir) const
 {
@@ -169,15 +176,11 @@ void Package::set_temp_dir(FileName const & temp_dir) const
 FileName Package::messages_file(string const & c) const
 {
        if (in_build_dir_) {
-                FileName res = FileName(lyx_dir().absFileName() + "/po/"
-                                                + c + ".gmo");
-                if (!res.isReadableFile())
-                        res = FileName(top_srcdir().absFileName() + "/po/"
-                                                + c + ".gmo");
-
+               FileName res = FileName(lyx_dir().absFileName() + "/../po/" + c + ".gmo");
+               if (!res.isReadableFile())
+                       res = FileName(top_srcdir().absFileName() + "/po/" + c + ".gmo");
                return res;
-        }
-       else
+       } else
                return FileName(locale_dir_.absFileName() + "/" + c
                        + "/LC_MESSAGES/" PACKAGE ".mo");
 }