added message to diagnose libman entry registration failure

This commit is contained in:
Basile Burg 2015-05-15 09:35:53 +02:00
parent 528bf566f0
commit 936c1b4a98
1 changed files with 14 additions and 0 deletions

View File

@ -160,10 +160,19 @@ procedure TCELibManEditorWidget.btnRegClick(Sender: TObject);
var var
str: TStringList; str: TStringList;
root: string; root: string;
lalias: string;
i: integer; i: integer;
begin begin
if fProj = nil then exit; if fProj = nil then exit;
// //
lalias := ExtractFileNameOnly(fProj.Filename);
if List.Items.FindCaption(0, lalias, false, false, false) <> nil then
begin
dlgOkInfo(format('a library item with the alias "%s" already exists, delete it before trying again.',
[lalias]));
exit;
end;
//
str := TStringList.Create; str := TStringList.Create;
try try
for i := 0 to fProj.Sources.Count-1 do for i := 0 to fProj.Sources.Count-1 do
@ -171,7 +180,10 @@ begin
root := commonFolder(str); root := commonFolder(str);
root := ExtractFileDir(root); root := ExtractFileDir(root);
if root = '' then if root = '' then
begin
dlgOkInfo('the static library can not be registered because its sources files has not a common folder');
exit; exit;
end;
// //
with List.Items.Add do with List.Items.Add do
begin begin
@ -181,6 +193,8 @@ begin
else else
SubItems.add(fProj.outputFilename); SubItems.add(fProj.outputFilename);
SubItems.add(root); SubItems.add(root);
if not FileExists(SubItems[0]) then
dlgOkInfo('the library file does not exist, maybe the project not been already compiled ?');
Selected:= true; Selected:= true;
end; end;
SetFocus; SetFocus;