[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevelop/buildtools/importers/cmake
From:       Matt Rogers <mattr () kde ! org>
Date:       2006-09-23 15:49:25
Message-ID: 1159026565.087829.26857.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 587664 by mattr:

rename the cmake kconfig xt stuff so that it doesn't clash with other
config.h files of the same name elsewhere in the build tree. 

build correctly when starting with a clean build dir

add the first bit of xml parsing code for the cmake build info file.



 M  +14 -6     CMakeLists.txt  
 A             cmakeconfig.kcfg   config.kcfg#587340
 A             cmakeconfig.kcfgc   config.kcfgc#587340
 M  +33 -5     cmakeimporter.cpp  
 M  +1 -1      cmakepreferences.cpp  
 D             config.kcfg  
 D             config.kcfgc  


--- trunk/KDE/kdevelop/buildtools/importers/cmake/CMakeLists.txt #587663:587664
@@ -1,4 +1,3 @@
-add_subdirectory( cmakelib )
 
 include_directories(
  ${CMAKE_SOURCE_DIR}/lib 
@@ -7,9 +6,12 @@
  ${CMAKE_SOURCE_DIR}/lib/util
 )
 
+set( cmakecommon_SRCS 
+  cmaketargetitem.cpp
+ )
+
 set( cmakeimporter_SRCS
   cmakeimporter.cpp
-  cmaketargetitem.cpp
 )
 
 set( cmakesettings_SRCS
@@ -21,17 +23,22 @@
 )
 
 remove_definitions( -DQT_NO_STL )
+
+kde4_automoc( ${cmakecommon_SRCS} )
+kde4_add_kcfg_files( cmakecommon_SRCS cmakeconfig.kcfgc )
+kde4_add_library( kdevcmakecommon SHARED ${cmakecommon_SRCS} )
+target_link_libraries( kdevcmakecommon ${KDE4_KDECORE_LIBS}
+                       kdevplatform )
+
 kde4_automoc( ${cmakeimporter_SRCS} )
-kde4_add_kcfg_files( cmakeimporter_SRCS config.kcfgc )
 kde4_add_plugin( kdevcmakeimporter ${cmakeimporter_SRCS} )
 target_link_libraries( kdevcmakeimporter ${KDE4_KDECORE_LIBS} 
-                       kdevplatform CMakeLib )
+                       kdevplatform kdevcmakecommon)
 
 kde4_automoc( ${cmakesettings_SRCS} )
 kde4_add_ui_files( cmakesettings_SRCS ${cmakesettings_UI} )
-kde4_add_kcfg_files( cmakesettings_SRCS config.kcfgc )
 kde4_add_plugin( kcm_kdevcmake_settings ${cmakesettings_SRCS} )
-target_link_libraries( kcm_kdevcmake_settings ${KDE4_KUTILS_LIBS} kdevplatform \
CMakeLib ) +target_link_libraries( kcm_kdevcmake_settings ${KDE4_KUTILS_LIBS} \
kdevplatform kdevcmakecommon )  
 
 
@@ -39,6 +46,7 @@
 kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kcm_kdevcmake_settings )
 install(TARGETS kdevcmakeimporter DESTINATION ${PLUGIN_INSTALL_DIR} )
 install(TARGETS kcm_kdevcmake_settings DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(TARGETS kdevcmakecommon DESTINATION ${LIB_INSTALL_DIR} )
 install(FILES kdevcmakeimporter.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
 install(FILES kcm_kdevcmake_settings.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
 install( FILES data.kdev4 DESTINATION ${DATA_INSTALL_DIR}/kdevcmakeimporter )
--- trunk/KDE/kdevelop/buildtools/importers/cmake/cmakeimporter.cpp #587663:587664
@@ -22,15 +22,19 @@
 
 #include <QList>
 #include <QVector>
+#include <QDomDocument>
 #include <QCoreApplication>
 
+
 #include <kurl.h>
+#include <kio/job.h>
 
+#include "kdevcore.h"
 #include "kdevproject.h"
 #include "kgenericfactory.h"
 #include "kdevprojectmodel.h"
 
-#include "config.h"
+#include "cmakeconfig.h"
 #include "cmaketargetitem.h"
 
 typedef KGenericFactory<CMakeImporter> CMakeSupportFactory ;
@@ -41,8 +45,7 @@
                               const QStringList& )
     : KDevBuildManager( CMakeSupportFactory::instance(), parent ), m_rootItem(0L)
 {
-    m_project = qobject_cast<KDevProject*>( parent );
-    Q_ASSERT( m_project );
+    m_project = 0;
 /*    CMakeSettings* settings = CMakeSettings::self();
 
     //what do the settings say about our generator?
@@ -75,11 +78,36 @@
 KDevProjectItem* CMakeImporter::import( KDevProjectModel* model,
                                            const KUrl& fileName )
 {
-    QString projectPath = m_project->folder().path();
-    kDebug( 9025 ) << k_funcinfo << "project path is " << projectPath << endl;
     QString buildDir = CMakeSettings::self()->buildFolder();
     kDebug( 9025 ) << k_funcinfo << "build dir is " << qPrintable( buildDir ) << \
endl;  m_rootItem = new KDevProjectFolderItem( fileName, 0 );
+    KUrl cmakeInfoFile(buildDir);
+    cmakeInfoFile.addPath("/cmakeinfo.xml");
+    if ( !cmakeInfoFile.isLocalFile() )
+    {
+        //FIXME turn this into a real warning
+        kWarning(9025) << "not a local file. CMake support doesn't handle remote \
projects" << endl; +    }
+    else
+    {
+        QFile cmakeFile(cmakeInfoFile.path());
+        if ( cmakeFile.open(QIODevice::ReadOnly) )
+        {
+            QDomDocument cmakeInfo;
+            if ( cmakeInfo.setContent( &cmakeFile ) )
+            {   //start processing
+                QDomElement docElem = cmakeInfo.documentElement();
+                QDomNode n = docElem.firstChild();
+                while(!n.isNull()) {
+                    QDomElement e = n.toElement(); // try to convert the node to an \
element. +                    if(!e.isNull()) {
+                        kDebug(9025) << e.tagName() << endl; // the node really is \
an element. +                    }
+                    n = n.nextSibling();
+                }
+            }
+        }
+    }
     return m_rootItem;
 }
 
--- trunk/KDE/kdevelop/buildtools/importers/cmake/cmakepreferences.cpp #587663:587664
@@ -28,7 +28,7 @@
 #include <kgenericfactory.h>
 
 #include "ui_cmakebuildsettings.h"
-#include "config.h"
+#include "cmakeconfig.h"
 
 typedef KGenericFactory<CMakePreferences> CMakePreferencesFactory;
 K_EXPORT_COMPONENT_FACTORY( kcm_kdevcmake_settings, CMakePreferencesFactory( \
"kcm_kdevcmake_settings" )  )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic