]> git.lyx.org Git - features.git/commitdiff
- Fix compilation for MSVC after latest package.C changes
authorAsger Ottar Alstrup <alstrup@lyx.org>
Tue, 1 Feb 2005 16:08:05 +0000 (16:08 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Tue, 1 Feb 2005 16:08:05 +0000 (16:08 +0000)
- Fix the redundant _moc.C files which aren't necessary in the project file

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9563 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/lyx.vcproj
development/Win32/package.C
development/Win32/readme.txt

index 507b641f63739456ec56bae81d98e4574ddf6222..8632aa7b92e48e5b421f6b34d4f73b0a8a317bcc 100644 (file)
                                                                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>
index 530342f9746b8e7fecf8c7003a4320af2c621e5a..c7819007e168289b227c8e2b866698ea73cd6a14 100644 (file)
@@ -24,8 +24,8 @@
 #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>
@@ -53,7 +53,6 @@ using std::string;
 
 namespace fs = boost::filesystem;
 
-
 namespace lyx {
 namespace support {
 
@@ -67,7 +66,8 @@ bool initialised_ = false;
 
 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_)
@@ -75,7 +75,8 @@ void init_package(string const & command_line_arg0,
 
        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;
 }
 
@@ -94,7 +95,9 @@ namespace {
 
 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);
 
@@ -118,7 +121,8 @@ get_user_support_dir(string const & default_user_support_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();
@@ -130,7 +134,7 @@ Package::Package(string const & command_line_arg0,
 
        // 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_ =
@@ -165,20 +169,20 @@ namespace {
 // 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
@@ -186,7 +190,7 @@ string const hardcoded_system_support_dir()
 
 string const & Package::top_srcdir() const
 {
-       static string const dir("c:\\lyx\\lyx-devel");
+       static string const dir("%TOP_SRCDIR%");
        return dir;
 }
 
@@ -225,7 +229,27 @@ string const win32_folder_path(int folder_id)
 #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...";
 
@@ -242,7 +266,7 @@ std::pair<string, string> const get_build_dirs(string const & abs_binary)
                // 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".
@@ -257,7 +281,18 @@ std::pair<string, string> const get_build_dirs(string const & abs_binary)
                        }
                }
 
-               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;
@@ -307,12 +342,12 @@ string const get_locale_dir(string const & system_support_dir)
        // 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();
@@ -459,7 +494,46 @@ get_system_support_dir(string const & abs_binary,
                        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.
@@ -604,7 +678,7 @@ bool check_env_var_dir(string const & 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
@@ -613,7 +687,7 @@ bool check_env_var_dir(string const & dir,
                // translation.
                string const fmt =
                _("Invalid %1$s environment variable.\n%2$s is not a directory.");
-               
+
                lyxerr << bformat(fmt, env_var, dir)
                       << std::endl;
        }
index 648dd9da72357a7c310997f8af44a66f8a865db9..484ab6065f2553761837c208e4510fb1ad06aee7 100644 (file)
@@ -9,8 +9,8 @@ To compile using MicroSoft Visual Studio 2003.NET, do this:
 3) Apply the win32_kludge.diff using GNU patch. Download from
    http://gnuwin32.sourceforge.net/packages/patch.htm
    and type "patch -p0 < development\win32\win32_kludge.diff"
-   in cmd box with current working directory right outside
-   lyx-devel
+   in cmd box with current working directory lyx-devel. 
+   Make sure that patch is in your path. (c:\program files\gnuwin32\bin)
 4) Open the development\win32\lyx.sln file in Visual Studio,
    compile and run. You can probably also use the free version
    of Microsoft's compiler, but I haven't tried that.