libman, improved register from project.

- libraries made of a single source are more likely to be registered without having to patch the path
- some exception still exist, for example the libraries with several leading empty sub folders (shitty example src/org/eclipse/swt...) 💩
This commit is contained in:
Basile Burg 2015-08-15 09:28:56 +02:00
parent 1fb0c2b432
commit 1d769d3583
1 changed files with 8 additions and 2 deletions

View File

@ -187,8 +187,14 @@ begin
try
for i := 0 to fProj.Sources.Count-1 do
str.Add(fProj.getAbsoluteSourceName(i));
root := commonFolder(str);
root := ExtractFileDir(root);
// single source libs usually have the structure "src/<fname>"
if str.Count = 1 then
root := ExtractFileDir(str.Strings[0])
// multi source libs have the structure "src/LibName/<fname>"/...
else begin
root := commonFolder(str);
root := ExtractFileDir(root);
end;
if root = '' then
begin
dlgOkInfo('the static library can not be registered because its source files have no common folder');