PATCH: make Kompare capable of being built in isolation from other KDE projects

Ryan Saunders jediry01 at yahoo.com
Thu Jun 23 21:04:28 CEST 2011


The CMake scripts for Kompare assume that CMAKE_SOURCE_DIR is the parent directory of Kompare. This is only true if Kompare is being built as a sub-target of a larger build (e.g., all of KDE). For someone like me who just grabbed Kompare out of svn, and installed the rest of the KDE devel headers via my distro's package manager, this doesn't work, because the makefiles end up looking for kompare/kompare/libdiff2/..., since CMAKE_SOURCE_DIR is "kompare" rather than its parent dir.

This patch fixes this, by declaring a variable, KOMPARE_SOURCE_DIR, and setting it appropriately in the top-level Kompare CMake file. I also added some KDE stuff that is needed by the top-level CMake file (which it is presumably inheriting from its parent, when not being built alone).

What's the procedure for submitting a patch like this? Assuming this patch is acceptable to you, will one of y'all submit it for me? Or do I need to get svn commit rights myself somehow?

Thanks,
R


Index: libdiff2/CMakeLists.txt
===================================================================
--- libdiff2/CMakeLists.txt    (revision 1236960)
+++ libdiff2/CMakeLists.txt    (working copy)
@@ -1,5 +1,5 @@
 
-include_directories( ${CMAKE_SOURCE_DIR}/kompare/libdialogpages ${CMAKE_SOURCE_DIR}/kompare/komparepart ${CMAKE_SOURCE_DIR}/kompare/interfaces  )
+include_directories( ${KOMPARE_SOURCE_DIR}/libdialogpages ${KOMPARE_SOURCE_DIR}/komparepart ${KOMPARE_SOURCE_DIR}/interfaces  )
 
 
 ########### next target ###############
Index: libdiff2/kompare.h
===================================================================
--- libdiff2/kompare.h    (revision 1236960)
+++ libdiff2/kompare.h    (working copy)
@@ -57,7 +57,7 @@
         ComparingStringFile, // Compare a source string with a destination file
         ComparingDirs,       // compareDirs
         ShowingDiff,         // openDiff
-        BlendingDir,         // openDirAnfDiff
+        BlendingDir,         // openDirAndDiff
         BlendingFile,        // openFileAndDiff
         UnknownMode          // Used to initialize the Infoi struct
     };
Index: komparepart/CMakeLists.txt
===================================================================
--- komparepart/CMakeLists.txt    (revision 1236960)
+++ komparepart/CMakeLists.txt    (working copy)
@@ -1,5 +1,5 @@
 
-include_directories( ${CMAKE_SOURCE_DIR}/kompare/libdialogpages ${CMAKE_SOURCE_DIR}/kompare/libdiff2 ${CMAKE_SOURCE_DIR}/kompare/interfaces  )
+include_directories( ${KOMPARE_SOURCE_DIR}/libdialogpages ${KOMPARE_SOURCE_DIR}/libdiff2 ${KOMPARE_SOURCE_DIR}/interfaces  )
 
 
 ########### next target ###############
Index: libdialogpages/CMakeLists.txt
===================================================================
--- libdialogpages/CMakeLists.txt    (revision 1236960)
+++ libdialogpages/CMakeLists.txt    (working copy)
@@ -1,5 +1,5 @@
 
-include_directories( ${CMAKE_SOURCE_DIR}/kompare/libdiff2  )
+include_directories( ${KOMPARE_SOURCE_DIR}/libdiff2  )
 
 
 ########### next target ###############
Index: komparenavtreepart/CMakeLists.txt
===================================================================
--- komparenavtreepart/CMakeLists.txt    (revision 1236960)
+++ komparenavtreepart/CMakeLists.txt    (working copy)
@@ -1,5 +1,5 @@
 
-include_directories( ${CMAKE_SOURCE_DIR}/kompare/libdiff2 ${CMAKE_SOURCE_DIR}/kompare/komparepart  )
+include_directories( ${KOMPARE_SOURCE_DIR}/libdiff2 ${KOMPARE_SOURCE_DIR}/komparepart  )
 
 
 ########### next target ###############
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt    (revision 1236960)
+++ CMakeLists.txt    (working copy)
@@ -1,5 +1,11 @@
 project(kompare)
 
+find_package( KDE4 REQUIRED )
+include( KDE4Defaults )
+include_directories( ${KDE4_INCLUDES} )
+
+set( KOMPARE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
+
 # TODO port away from QT3_SUPPORT
 add_definitions(-DQT3_SUPPORT)
 
@@ -10,7 +16,7 @@
 add_subdirectory( komparepart )
 add_subdirectory( pics )
 
-include_directories(  ${CMAKE_CURRENT_SOURCE_DIR}/komparepart ${CMAKE_CURRENT_SOURCE_DIR}/libdiff2 ${CMAKE_CURRENT_SOURCE_DIR}/libdialogpages ${CMAKE_CURRENT_SOURCE_DIR}/interfaces ${CMAKE_CURRENT_SOURCE_DIR}/komparenavtreepart ${CMAKE_CURRENT_SOURCE_DIR}/komparepart)
+include_directories(  ${KOMPARE_SOURCE_DIR}/komparepart ${KOMPARE_SOURCE_DIR}/libdiff2 ${KOMPARE_SOURCE_DIR}/libdialogpages ${KOMPARE_SOURCE_DIR}/interfaces ${KOMPARE_SOURCE_DIR}/komparenavtreepart ${KOMPARE_SOURCE_DIR}/komparepart)
 
 
 ########### next target ###############
@@ -21,7 +27,7 @@
 kompareurldialog.cpp
 )
 
-kde4_add_app_icon(kompare_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/hi*-app-kompare.png")
+kde4_add_app_icon(kompare_SRCS "${KOMPARE_SOURCE_DIR}/pics/hi*-app-kompare.png")
 
 kde4_add_executable(kompare ${kompare_SRCS})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kompare-devel/attachments/20110623/c7bc1c83/attachment.htm 


More information about the Kompare-devel mailing list