CompileAs="2"/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\QToc.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- </File>
<File
RelativePath="..\..\src\frontends\qt2\QTocDialog.C">
<FileConfiguration
CompileAs="2"/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\qtTimeout.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- </File>
<File
RelativePath="..\..\src\frontends\qt2\QtView.C">
<FileConfiguration
<File
RelativePath="..\..\src\frontends\qt2\Qurl.c">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\QURL.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- </File>
<File
RelativePath="..\..\src\frontends\qt2\QURLDialog.C">
<FileConfiguration
CompileAs="2"/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\QVSpace.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- </File>
<File
RelativePath="..\..\src\frontends\qt2\QVSpaceDialog.C">
<FileConfiguration
CompileAs="2"/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\QWorkArea.h">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- CommandLine=""
- Outputs=""/>
- </FileConfiguration>
- </File>
<File
RelativePath="..\..\src\frontends\qt2\QWrap.C">
<FileConfiguration
<Tool
Name="VCCustomBuildTool"
CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\frontends\qt2\QToc.h">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
"
Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
</FileConfiguration>
<Tool
Name="VCCustomBuildTool"
CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\frontends\qt2\qtTimeout.h">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
"
Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
</FileConfiguration>
<Tool
Name="VCCustomBuildTool"
CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\frontends\qt2\QURL.h">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
"
Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
</FileConfiguration>
<Tool
Name="VCCustomBuildTool"
CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\frontends\qt2\QVSpace.h">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
"
Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
</FileConfiguration>
<Tool
Name="VCCustomBuildTool"
CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\frontends\qt2\QWorkArea.h">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
+"
+ Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="%QTDIR%\bin\moc -o $(InputDir)moc\$(InputName)_moc.C $(InputPath)
"
Outputs="$(InputDir)moc\$(InputName)_moc.C"/>
</FileConfiguration>
<File
RelativePath="..\..\src\frontends\qt2\moc\BulletsModule_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\checkedwidgets_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\emptytable_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\iconpalette_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\lcolorcache_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\lengthcombo_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\panelstack_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QAbout_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QAboutDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QBibitem_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QBibitemDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QBibtexDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QBox_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QBoxDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QBranch_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QBranchDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QBrowseBox_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QChanges_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QChangesDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QCharacter_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QCharacterDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QCitation_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QCitationDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\qcoloritem_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QCommandBuffer_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QDialogView_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QDocument_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QDocumentDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QErrorList_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QErrorListDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QERT_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QERTDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QExternal_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QExternalDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QFloat_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QFloatDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\qfont_loader_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\qfontexample_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QGraphicsDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\qgridview_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QInclude_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QIncludeDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QIndex_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QIndexDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QLImage_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\qlkey_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QLMenubar_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QLog_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QLogDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QLPainter_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QLPopupMenu_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QLToolbar_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QLyXKeySym_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QMath_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QMathDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QMathMatrixDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QNote_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QNoteDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QParagraph_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QParagraphDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QPrefs_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QPrefsDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QPrint_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QRef_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QRefDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\qscreen_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QSearch_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QSearchDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QSendto_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QSendtoDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\qsetborder_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QShowFile_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QShowFileDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QSpellchecker_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QSpellcheckerDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\Qt2BC_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QTabular_moc.C">
- </File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QTabularCreate_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QTabularCreateDialog_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QTabularDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QTexinfo_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QTexinfoDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QThesaurus_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QThesaurusDialog_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QtLyXView_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QToc_moc.C">
</File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QWorkArea_moc.C">
</File>
- <File
- RelativePath="..\..\src\frontends\qt2\moc\QWrap_moc.C">
- </File>
<File
RelativePath="..\..\src\frontends\qt2\moc\QWrapDialog_moc.C">
</File>
#include "support/os.h"
#include <boost/assert.hpp>
-#include <boost/tuple/tuple.hpp>
#include <boost/filesystem/operations.hpp>
+#include <boost/tuple/tuple.hpp>
#include <list>
#include <utility>
namespace fs = boost::filesystem;
-
namespace lyx {
namespace support {
void init_package(string const & command_line_arg0,
string const & command_line_system_support_dir,
- string const & command_line_user_support_dir)
+ string const & command_line_user_support_dir,
+ exe_build_dir_to_top_build_dir top_build_dir_location)
{
// Can do so only once.
if (initialised_)
package_ = Package(command_line_arg0,
command_line_system_support_dir,
- command_line_user_support_dir);
+ command_line_user_support_dir,
+ top_build_dir_location);
initialised_ = true;
}
string const abs_path_from_binary_name(string const & exe);
-std::pair<string, string> const get_build_dirs(string const & abs_binary);
+std::pair<string, string> const
+get_build_dirs(string const & abs_binary,
+ exe_build_dir_to_top_build_dir top_build_dir_location);
string const get_document_dir(string const & home_dir);
Package::Package(string const & command_line_arg0,
string const & command_line_system_support_dir,
- string const & command_line_user_support_dir)
+ string const & command_line_user_support_dir,
+ exe_build_dir_to_top_build_dir top_build_dir_location)
: explicit_user_support_dir_(false)
{
home_dir_ = get_home_dir();
// Is LyX being run in-place from the build tree?
boost::tie(build_support_dir_, system_support_dir_) =
- get_build_dirs(abs_binary);
+ get_build_dirs(abs_binary, top_build_dir_location);
if (build_support_dir_.empty())
system_support_dir_ =
// configuration-time.
string const top_srcdir()
{
- static string const dir("c:\\lyx\\lyx-devel");
+ static string const dir("%TOP_SRCDIR%");
return dir;
}
string const hardcoded_localedir()
{
- return string("c:\\lyx\\lyx-devel\\lib\\locale");
+ return string("%LOCALEDIR%");
}
string const hardcoded_system_support_dir()
{
- return string("c:\\lyx\\lyx-devel\\lib");
+ return string("%LYX_DIR%");
}
} // namespace anon
string const & Package::top_srcdir() const
{
- static string const dir("c:\\lyx\\lyx-devel");
+ static string const dir("%TOP_SRCDIR%");
return dir;
}
#endif
-std::pair<string, string> const get_build_dirs(string const & abs_binary)
+std::string const
+get_build_support_dir(std::string const & binary_dir,
+ exe_build_dir_to_top_build_dir top_build_dir_location)
+{
+ string indirection;
+ switch (top_build_dir_location) {
+ case top_build_dir_is_one_level_up:
+ indirection = "../lib";
+ break;
+ case top_build_dir_is_two_levels_up:
+ indirection = "../../lib";
+ break;
+ }
+
+ return NormalizePath(AddPath(binary_dir, indirection));
+}
+
+
+std::pair<string, string> const
+get_build_dirs(string const & abs_binary,
+ exe_build_dir_to_top_build_dir top_build_dir_location)
{
string const check_text = "Checking whether LyX is run in place...";
// Try and find "lyxrc.defaults".
string const binary_dir = OnlyPath(binary);
string const build_support_dir =
- NormalizePath(AddPath(binary_dir, "../lib"));
+ get_build_support_dir(binary_dir, top_build_dir_location);
if (!FileSearch(build_support_dir, "lyxrc.defaults").empty()) {
// Try and find "chkconfig.ltx".
}
}
- break;
+ // Check whether binary is a symbolic link.
+ // If so, resolve it and repeat the exercise.
+ if (!fs::symbolic_link_exists(binary))
+ break;
+
+ string link;
+ if (LyXReadLink(binary, link, true)) {
+ binary = link;
+ } else {
+ // Unable to resolve the link.
+ break;
+ }
}
lyxerr[Debug::INIT] << check_text << " no" << std::endl;
// be "../locale/".)
path = NormalizePath(AddPath(system_support_dir, relative_locale_dir()));
- if (fs::is_directory(path))
+ if (fs::exists(path) && fs::is_directory(path))
return path;
// 3. Fall back to the hard-coded LOCALEDIR.
path = hardcoded_localedir();
- if (fs::is_directory(path))
+ if (fs::exists(path) && fs::is_directory(path))
return path;
return string();
return lyxdir;
}
- break;
+ // Check whether binary is a symbolic link.
+ // If so, resolve it and repeat the exercise.
+ if (!fs::symbolic_link_exists(binary))
+ break;
+
+ string link;
+ if (LyXReadLink(binary, link, true)) {
+ binary = link;
+ } else {
+ // Unable to resolve the link.
+ break;
+ }
+ }
+
+ // 4. Repeat the exercise on the directory itself.
+ string binary_dir = OnlyPath(abs_binary);
+ while (true) {
+ // This time test whether the directory is a symbolic link
+ // *before* looking for "chkconfig.ltx".
+ // (We've looked relative to the original already.)
+ if (!fs::symbolic_link_exists(binary))
+ break;
+
+ string link;
+ if (LyXReadLink(binary_dir, link, true)) {
+ binary_dir = link;
+ } else {
+ // Unable to resolve the link.
+ break;
+ }
+
+ // Try and find "chkconfig.ltx".
+ string const lyxdir =
+ NormalizePath(AddPath(binary_dir, relative_lyxdir));
+ searched_dirs.push_back(lyxdir);
+
+ if (!FileSearch(lyxdir, chkconfig_ltx).empty()) {
+ // Success! "chkconfig.ltx" has been found.
+ return lyxdir;
+ }
}
// 5. In desparation, try the hard-coded system support dir.
bool check_env_var_dir(string const & dir,
string const & env_var)
{
- bool const success = fs::is_directory(dir);
+ bool const success = (fs::exists(dir) && fs::is_directory(dir));
if (!success) {
// Put this string on a single line so that the gettext
// translation.
string const fmt =
_("Invalid %1$s environment variable.\n%2$s is not a directory.");
-
+
lyxerr << bformat(fmt, env_var, dir)
<< std::endl;
}