[kdevplatform] f465271 Uff. Unify #include's across libs and plugins.

Andreas Pakulat apaku at gmx.de
Sun Aug 29 20:12:30 UTC 2010


commit f46527110e6969bbfbe761113c966a4c0e9d33f1
Author: Andreas Pakulat <apaku at gmx.de>
Date:   Sat Aug 2 00:12:38 2008 +0000

    Uff. Unify #include's across libs and plugins.
    
    The #include's now follow these rules:
    
    For libraries
     - #include <foo.h> / #include <Foo> for anything outside kdevplatform - i.e.
       other libraries
     - #include "foo.h" or #include "../foo.h" or #include "bar/foo.h" or #include
       "../bar/foo.h" for headers that are inside the same library
     - #include <bar/foo.h> for any library bar in kdevplatform
    
    For plugins
     - #include "foo.h" only for files inside the plugin
     - #include <bar/foo.h> for any kdevplatform library bar
     - #include <foo.h> / #include <Foo> for any other libs
    
    This allows us to remove all include_directories() calls, so we're only have -I
    switches for "external" libs (like KDE/Qt) and the top-level source/binary dir
    as well as the "current" source/binary dir.
    
    This is also supposed to make our header safer against include-problems, like
    using #include <icore.h> and that picks up a header of similar name from some
    other lib.
    
    We've had a discussion about this quite a while back. Still if anybody feels
    like this still has problem please speak up.
    
    CCMAIL:kdevelop-devel at kdevelop.org

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2fc68c..bcc27ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,5 @@
 add_subdirectory(tests)
 
-include_directories( ${KDE4_INCLUDES}
-    ${CMAKE_SOURCE_DIR}/util
-    ${CMAKE_SOURCE_DIR}/interfaces
-    ${CMAKE_SOURCE_DIR}/project
-    ${CMAKE_SOURCE_DIR}/vcs
-    ${CMAKE_SOURCE_DIR}/vcs/interfaces
-    ${CMAKE_SOURCE_DIR}/vcs/models
-    ${CMAKE_SOURCE_DIR}/vcs/dvcs/
-)
-
-
 ########### next target ###############
 
 set(kdevgit_PART_SRCS
diff --git a/gitexecutor.cpp b/gitexecutor.cpp
index 1d6e652..d7680f0 100644
--- a/gitexecutor.cpp
+++ b/gitexecutor.cpp
@@ -32,8 +32,8 @@
 #include <KShell>
 #include <KDebug>
 
-#include <dvcsjob.h>
-#include <iplugin.h>
+#include <vcs/dvcs/dvcsjob.h>
+#include <interfaces/iplugin.h>
 
 GitExecutor::GitExecutor(KDevelop::IPlugin* parent)
     : QObject(parent), vcsplugin(parent)
diff --git a/gitexecutor.h b/gitexecutor.h
index 8f075f5..cca7f75 100644
--- a/gitexecutor.h
+++ b/gitexecutor.h
@@ -29,8 +29,8 @@
 #include <KJob>
 #include <QStringList>
 
-#include <idvcsexecutor.h>
-#include "vcsrevision.h"
+#include <vcs/dvcs/idvcsexecutor.h>
+#include <vcs/vcsrevision.h>
 
 class DVCSjob;
 
diff --git a/gitplugin.cpp b/gitplugin.cpp
index 62078f5..13fcf8d 100644
--- a/gitplugin.cpp
+++ b/gitplugin.cpp
@@ -25,13 +25,13 @@
 #include <klocalizedstring.h>
 #include <QDebug>
 
-#include <icore.h>
-#include <iprojectcontroller.h>
+#include <interfaces/icore.h>
+#include <interfaces/iprojectcontroller.h>
 #include <interfaces/iproject.h>
 
-#include "vcsjob.h"
-#include "vcsrevision.h"
-#include <dvcsjob.h>
+#include <vcs/vcsjob.h>
+#include <vcs/vcsrevision.h>
+#include <vcs/dvcs/dvcsjob.h>
 
 #include "gitexecutor.h"
 
diff --git a/gitplugin.h b/gitplugin.h
index 1e8caff..b3262ef 100644
--- a/gitplugin.h
+++ b/gitplugin.h
@@ -22,7 +22,7 @@
 #define GIT_PLUGIN_H
 
 #include <vcs/interfaces/idistributedversioncontrol.h>
-#include <dvcs/dvcsplugin.h>
+#include <vcs/dvcs/dvcsplugin.h>
 #include <qobject.h>
 
 namespace KDevelop
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 80bf727..35c5a5c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -17,14 +17,6 @@ FIND_PROGRAM(GIT NAMES git
 
 if (GIT)
 
-	include_directories( ${KDE4_INCLUDES}
-		${CMAKE_SOURCE_DIR}
-        ${CMAKE_SOURCE_DIR}/util
-        ${CMAKE_SOURCE_DIR}/interfaces
-		${CMAKE_SOURCE_DIR}/vcs
-		${CMAKE_SOURCE_DIR}/plugins/git
-        ${CMAKE_SOURCE_DIR}/vcs/dvcs/
-	)
     set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
 	set(gitInitTest_SRCS initTest.cpp ../gitexecutor.cpp)
     kde4_add_unit_test(kdevgit-test ${gitInitTest_SRCS})
@@ -36,4 +28,4 @@ if (GIT)
 	)
 endif (GIT)
 
-endif (UNIX)
\ No newline at end of file
+endif (UNIX)
diff --git a/tests/initTest.cpp b/tests/initTest.cpp
index 15512a2..7bc6eb0 100644
--- a/tests/initTest.cpp
+++ b/tests/initTest.cpp
@@ -31,8 +31,8 @@
 #include <KDebug>
 #include <kio/netaccess.h>
 
-#include <dvcsjob.h>
-#include <gitexecutor.h>
+#include <vcs/dvcs/dvcsjob.h>
+#include "../gitexecutor.h"
 
 #define GITTEST_DIR1                    "kdevGit_testdir"
 #define GITTEST_BASEDIR_NO_TR_SLASH     "/tmp/kdevGit_testdir"




More information about the KDevelop-devel mailing list