Bug 61969

Summary: incorrect handling of libs in nested subdirs by qmake manager
Product: [Applications] kdevelop Reporter: Andreas Koepfle <andreas.koepfle>
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: project structure for testcase
patch wrong libs handling in nested subdirs

Description Andreas Koepfle 2003-08-01 19:09:15 UTC
Version:           3.0.0a5 cvs (using KDE KDE 3.1.2)
Installed from:    SuSE RPMs
Compiler:          gcc 3.3 prerelease 
OS:          Linux

qmake manager scrambles the LIBS and TARGETDEPS lines when linking to a lib, if the lib is in a nested subdirectory.

our project directory structure look like this:

|-libs
|    |-mylib1
|    |-mylib2
|    |-bin    
|
|-app

We put the created libraries in libs/bin (by setting DESTDIR=../bin in mylib1.pro & mylib2.pro)

Then after adding libs/mylib1 & libs/mylib2 in the Libraries dialog for app the corresponding lines in app.pro should read:

LIBS += ../libs/bin/libmylib1.a \
        ../libs/bin/libmylib2.a
TARGETDEPS += ../libs/bin/libmylib1.a \
              ../libs/bin/libmylib2.a

however they look like this:

LIBS += ../bin/libmylib1.a \
        ../bin/libmylib2.a
TARGETDEPS += ../bin/libmylib1.a \
              ../bin/libmylib2.a

I'm attaching a testcase and a patch that fixes this problem.
Comment 1 Andreas Koepfle 2003-08-01 19:11:45 UTC
Created attachment 2131 [details]
project structure for testcase
Comment 2 Andreas Koepfle 2003-08-01 19:20:28 UTC
Created attachment 2132 [details]
patch wrong libs handling in nested subdirs

The path to the libraries in the nested dirs is created wrong (just the last
subdir part is used). This patch fixes it by using thecomplete relative path to
the libdir instead.

PS: What is the preferred way of fixing this kind of bugs? Is it ok to create a
bug report and add a patch to it or should I rather send the patch directly to
the mailing list without adding a bug report for it?
Comment 3 Alexander Dymo 2003-08-01 19:24:25 UTC
Thanks again for your patches! 
It's a good idea to send them to kdevelop-devel though. 
Comment 4 Alexander Dymo 2003-08-01 20:59:21 UTC
Subject: kdevelop/parts/trollproject

CVS commit by dymo: 

applied patch from Andreas Koepfle <koepfle@ti.uni-mannheim.de> - fix dependencies and libraries handling for project files
CCMAIL: 61969-done@bugs.kde.org


  M +4 -4      trollprojectwidget.cpp   1.113


--- kdevelop/parts/trollproject/trollprojectwidget.cpp  #1.112:1.113
@@ -122,5 +122,5 @@ QString SubprojectItem::getSharedLibAddO
     if(configuration.m_destdir!="")
     {
-      tmpPath=downDirs+this->subdir+"/"+configuration.m_destdir;
+      tmpPath=downDirs+this->getRelativPath()+"/"+configuration.m_destdir;
     }else{
       tmpPath=downDirs+this->getRelativPath()+"/";
@@ -147,5 +147,5 @@ QString SubprojectItem::getApplicationOb
   if(configuration.m_destdir!="")
   {
-    tmpPath=downDirs+this->subdir+"/"+configuration.m_destdir;
+    tmpPath=downDirs+this->getRelativPath()+"/"+configuration.m_destdir;
   }else{
     tmpPath=downDirs+this->getRelativPath()+"/";
@@ -174,5 +174,5 @@ QString SubprojectItem::getLibAddObject(
     if(configuration.m_destdir!="")
     {
-      tmpPath=downDirs+this->subdir+"/"+configuration.m_destdir;
+      tmpPath=downDirs+this->getRelativPath()+"/"+configuration.m_destdir;
     }else{
       tmpPath=downDirs+this->getRelativPath()+"/";
@@ -204,5 +204,5 @@ QString SubprojectItem::getLibAddPath(QS
     if(configuration.m_destdir!="")
     {
-      tmpPath=downDirs+this->subdir+"/"+configuration.m_destdir;
+      tmpPath=downDirs+this->getRelativPath()+"/"+configuration.m_destdir;
     }else{
       tmpPath=downDirs+this->getRelativPath()+"/";