diff --git a/.gitattributes b/.gitattributes
index 3f1314dbaa..7d90736a9f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3867,6 +3867,8 @@ ide/buildmodediffdlg.lfm svneol=native#text/plain
ide/buildmodediffdlg.pas svneol=native#text/plain
ide/buildprofilemanager.lfm svneol=native#text/plain
ide/buildprofilemanager.pas svneol=native#text/plain
+ide/buildprojectdlg.lfm svneol=native#text/plain
+ide/buildprojectdlg.pas svneol=native#text/pascal
ide/charactermapdlg.lfm svneol=native#text/plain
ide/charactermapdlg.pas svneol=native#text/pascal
ide/checkcompileropts.lfm svneol=native#text/plain
diff --git a/ide/buildprojectdlg.lfm b/ide/buildprojectdlg.lfm
new file mode 100644
index 0000000000..b7cd8dc447
--- /dev/null
+++ b/ide/buildprojectdlg.lfm
@@ -0,0 +1,141 @@
+object BuildProjectDialog: TBuildProjectDialog
+ Left = 275
+ Height = 317
+ Top = 250
+ Width = 367
+ Caption = 'BuildProjectDialog'
+ ClientHeight = 317
+ ClientWidth = 367
+ OnCreate = FormCreate
+ Position = poScreenCenter
+ LCLVersion = '0.9.31'
+ object ButtonPanel1: TButtonPanel
+ Left = 6
+ Height = 40
+ Top = 271
+ Width = 355
+ OKButton.Name = 'OKButton'
+ OKButton.Caption = '&OK'
+ HelpButton.Name = 'HelpButton'
+ HelpButton.Caption = '&Help'
+ CloseButton.Name = 'CloseButton'
+ CloseButton.Caption = '&Close'
+ CancelButton.Name = 'CancelButton'
+ CancelButton.Caption = 'Cancel'
+ TabOrder = 0
+ ShowButtons = [pbOK, pbCancel, pbHelp]
+ end
+ object Panel1: TPanel
+ Left = 0
+ Height = 265
+ Top = 0
+ Width = 367
+ Align = alClient
+ BevelOuter = bvNone
+ ChildSizing.EnlargeHorizontal = crsScaleChilds
+ ChildSizing.EnlargeVertical = crsScaleChilds
+ ChildSizing.Layout = cclLeftToRightThenTopToBottom
+ ClientHeight = 265
+ ClientWidth = 367
+ TabOrder = 1
+ object ProjectGroupBox: TGroupBox
+ Left = 6
+ Height = 157
+ Top = 6
+ Width = 421
+ BorderSpacing.Around = 6
+ Caption = 'ProjectGroupBox'
+ ClientHeight = 138
+ ClientWidth = 417
+ TabOrder = 0
+ object ProjClearOutDirButton: TButton
+ AnchorSideLeft.Control = ProjectGroupBox
+ AnchorSideTop.Control = ProjectGroupBox
+ Left = 6
+ Height = 29
+ Top = 6
+ Width = 156
+ AutoSize = True
+ BorderSpacing.Around = 6
+ Caption = 'ProjClearOutDirButton'
+ TabOrder = 0
+ end
+ object ProjClearSrcDirsButton: TButton
+ AnchorSideLeft.Control = ProjectGroupBox
+ AnchorSideTop.Control = ProjClearOutDirButton
+ AnchorSideTop.Side = asrBottom
+ Left = 6
+ Height = 29
+ Top = 41
+ Width = 160
+ AutoSize = True
+ BorderSpacing.Around = 6
+ Caption = 'ProjClearSrcDirsButton'
+ TabOrder = 1
+ end
+ object ProjClearSrcDirMaskLabel: TLabel
+ AnchorSideLeft.Control = ProjClearSrcDirsButton
+ AnchorSideTop.Control = ProjClearSrcDirsButton
+ AnchorSideTop.Side = asrBottom
+ Left = 6
+ Height = 18
+ Top = 76
+ Width = 169
+ Caption = 'ProjClearSrcDirMaskLabel'
+ ParentColor = False
+ end
+ object ProjClearSrcDirMaskEdit: TEdit
+ Left = 205
+ Height = 27
+ Top = 95
+ Width = 80
+ TabOrder = 2
+ Text = 'ProjClearSrcDirMaskEdit'
+ end
+ end
+ object DependenciesGroupBox: TGroupBox
+ Left = 6
+ Height = 90
+ Top = 169
+ Width = 421
+ BorderSpacing.Around = 6
+ Caption = 'DependenciesGroupBox'
+ ClientHeight = 71
+ ClientWidth = 417
+ Constraints.MinHeight = 30
+ TabOrder = 1
+ object PkgClearOutDirsButton: TButton
+ Left = 106
+ Height = 25
+ Top = 3
+ Width = 75
+ Caption = 'PkgClearOutDirsButton'
+ TabOrder = 0
+ end
+ object PkgClearSrcDirsButton: TButton
+ Left = 152
+ Height = 25
+ Top = 34
+ Width = 75
+ Caption = 'PkgClearSrcDirsButton'
+ TabOrder = 1
+ end
+ object PkgClearSrcDirsMaskLabel: TLabel
+ Left = 242
+ Height = 18
+ Top = 43
+ Width = 175
+ Caption = 'PkgClearSrcDirsMaskLabel'
+ ParentColor = False
+ end
+ object PkgClearSrcDirsMaskEdit: TEdit
+ Left = 285
+ Height = 27
+ Top = 27
+ Width = 80
+ TabOrder = 2
+ Text = 'PkgClearSrcDirsMaskEdit'
+ end
+ end
+ end
+end
diff --git a/ide/buildprojectdlg.pas b/ide/buildprojectdlg.pas
new file mode 100644
index 0000000000..f44da973f9
--- /dev/null
+++ b/ide/buildprojectdlg.pas
@@ -0,0 +1,88 @@
+unit BuildProjectDlg;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
+ ExtCtrls, StdCtrls, IDEDialogs, LazarusIDEStrConsts, Project;
+
+type
+ TBuildCleanMode = (
+ bcmIfNeeded,
+ bcmNormal,
+ bcmWithB // with -B
+ );
+ TBuildCleanModes = set of TBuildCleanMode;
+
+ TBuildCleanParams = record
+ Mode: TBuildCleanMode;
+ CleanOutputDirectory: boolean;
+ CleanSrcDirs: string; // file masks separated by semicolon
+ end;
+
+ { TBuildProjectDialog }
+
+ TBuildProjectDialog = class(TForm)
+ ButtonPanel1: TButtonPanel;
+ DependenciesGroupBox: TGroupBox;
+ Panel1: TPanel;
+ PkgClearOutDirsButton: TButton;
+ PkgClearSrcDirsButton: TButton;
+ PkgClearSrcDirsMaskEdit: TEdit;
+ PkgClearSrcDirsMaskLabel: TLabel;
+ ProjClearOutDirButton: TButton;
+ ProjClearSrcDirMaskEdit: TEdit;
+ ProjClearSrcDirMaskLabel: TLabel;
+ ProjClearSrcDirsButton: TButton;
+ ProjectGroupBox: TGroupBox;
+ procedure FormCreate(Sender: TObject);
+ private
+ FProject: TProject;
+ public
+ procedure Init(AProject: TProject);
+ end;
+
+function ShowBuildProjectDialog(AProject: TProject): TModalResult;
+
+implementation
+
+function ShowBuildProjectDialog(AProject: TProject): TModalResult;
+var
+ BuildProjectDialog: TBuildProjectDialog;
+begin
+ BuildProjectDialog:=TBuildProjectDialog.Create(nil);
+ try
+ BuildProjectDialog.Init(AProject);
+ Result:=BuildProjectDialog.ShowModal;
+ finally
+ BuildProjectDialog.Free;
+ end;
+end;
+
+{$R *.lfm}
+
+{ TBuildProjectDialog }
+
+procedure TBuildProjectDialog.FormCreate(Sender: TObject);
+begin
+ Caption:='Build Project';
+ PrProjectGroupBoxaption:='Compile project:';
+ PrProjectGroupBoxtems.Add('Standard');
+ PrProjectGroupBoxtems.Add('with -B');
+ PrProjectGroupBoxtems.Add('Clean output directory');
+ DeDependenciesGroupBoxaption:='Compile used packages:';
+ DeDependenciesGroupBoxtems.Add('If needed');
+ DeDependenciesGroupBoxtems.Add('Compile');
+ DeDependenciesGroupBoxtems.Add('with -B');
+ DeDependenciesGroupBoxtems.Add('Clean output directory');
+end;
+
+procedure TBuildProjectDialog.Init(AProject: TProject);
+begin
+
+end;
+
+end.
+
diff --git a/ide/lazarus.lpi b/ide/lazarus.lpi
index 53cbe02511..c0e39635a6 100644
--- a/ide/lazarus.lpi
+++ b/ide/lazarus.lpi
@@ -60,7 +60,7 @@
-
+
@@ -627,6 +627,12 @@
+
+
+
+
+
+