我的一般问题的一个例子https://askubuntu.com/questions/485242/an-introduction-to-translating-and-debugging-source-code:我已安装“Qt 4 Designer”,并下载了 krusader-2.4.0-beta3.tar.bz2 文件。在打包的文件中,我看到CMakeLists.txt
包含
project(krusader)
INCLUDE(CPack)
set(VERSION "2.4.0-beta3" )
set(RELEASE_NAME "Single Step")
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include_directories( ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
set(CMAKE_VERBOSE_MAKEFILE OFF)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions( "-DKRARC_ENABLED" )
find_package(ACL)
if(ACL_FOUND)
add_definitions(-DHAVE_POSIX_ACL)
endif(ACL_FOUND)
\#include(ConfigureChecks.cmake)
add_subdirectory(krusader)
add_subdirectory(pics)
add_subdirectory(doc-extras)
add_subdirectory(krArc)
add_subdirectory(iso)
add_subdirectory(doc)
\#add_subdirectory(krfiledialog) - not used
\#add_subdirectory(virt) - not used
\#add_subdirectory(tar) - not used
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(TARDIR)")
include(MacroOptionalAddSubdirectory)
macro_optional_add_subdirectory( po )
我想我应该找到或选择我的目录并使用来定义它们
KDE4_INCLUDES=the directory
等等。我需要介绍一下规则;也许目录如下
/home/me_user/.kde/share/kde4/
/home/me_user/Ot/5.l.0/android_x86/src/android/java/src/org/kde/
/home/me_user/Ot/5.1.0/android_armv7/src/android/java/src/org/kde/
/home/me_user/G/Ot/krusader-2.4.0-beta3/pics/kde3/
/home/me_user/G/libreoffice-3.5.7.2/core/fpicker/source/unx/kde_unx/
/home/me_user/G/libreoffice-3.5.7.2/core/fpicker/source/unx/kde4/
/home/me_user/G/libreoffice-3.5.7.2/core/fpicker/source/unx/kde/
/home/me_user/G/libreoffice-3.5.7.2/core/scp2/source/kde/
/home/me_user/G/libreoffice-3.5.7.2/core/extras/unx/source/kde/
/home/me_user/G/libreoffice-3.5.7.2/core/shell/source/backends/kde4be/
/home/me_user/G/libreoffice-3.5.7.2/core/shell/source/backends/kdebe/
/home/me_user/G/libreoffice-3.5.7.2/core/vcl/unx/kde4/
/home/me_user/G/libreoffice-3.5.7.2/core/vcl/unx/kde/
/home/me_user/G/libreoffice-3.5.7.2/core/vcl/inc/unx/kde/
/tmp/kde-me_userMYlhh5/
/var/tmp/kdecache-root/
/var/tmp/kdecache-me_user/
/var/tmp/kdecache-she_user/
/var/tmp/kdecache-me_user/kio_help/usr/share/doc/kde/
/usr/share/kde4/
/usr/share/applications/kde4/
/usr/share/emoticons/kde4/
/usr/share/pyshared/softwareproperties/kde/
/usr/share/locale/ru/LC_SCRIPTS/kdelibs4/
/usr/share/locale/de/LC_SCRIPTS/kdelibs4/
/usr/share/doc/kde-l10n-cs/
/usr/share/doc/kdepim-runtime/
/usr/share/doc/kde-l10n-sk/
/usr/share/doc/kdepimlibs-kio-plugins/
/usr/share/doc/kde-l10n-de/
/usr/share/doc/kdelibs5-plugins/
/usr/share/doc/kde-l10n-engb/
/usr/share/doc/kde-runtime/
/usr/share/doc/kde/
/usr/share/doc/kde-runtime-data/
/usr/share/doc/kdelibs-bin/
/usr/share/doc/kdelibs5-data/
/usr/share/doc/kde-l10n-ru/
/usr/share/doc/kde/HTML/en/kdesu/
/usr/share/doc/kde/HTML/en/kdebugdialog/
/usr/share/doc/kde/HTML/en/kcontrol/kded/
/usr/share/doc/kde/HTML/ru/kdesu/
/usr/share/doc/kde/HTML/ru/kdebugdialog/
/usr/share/doc/kde/HTML/de/kdesu/
/usr/share/doc/kde/HTML/de/kdepasswd/
/usr/share/doc/kde/HTML/de/kdebugdialog/
/usr/share/doc/kde/HTML/de/kcontrol/kded/
/usr/share/kde4/apps/kdeui/
/usr/share/kde4/apps/kdewidgets/
/usr/share/kde4/apps/kde/
/usr/share/kde4/services/kded/
/usr/share/gettext/projects/KDE/
/usr/share/perl5/Debconf/FrontEnd/Kde/
/usr/share/perl5/Debconf/Element/Kde/
/usr/share/ontology/kde/
/usr/lib/kde4/
/usr/lib/kde4/libexec/kdesu~distrib/
/usr/lib/kde4/platformimports/touch/org/kde/
/usr/lib/kde4/imports/org/kde/
/usr/lib/python2.7/dist-packages/softwareproperties/kde/
或者我应该从 KDE 安装另一个包?
我试过打开
krusaderversion.h.cmake
(下载中唯一的*.cmake
文件)在“Qt Creator”中并构建它,但它需要很多参数。我想知道如何找到参数,尽可能直接从下载的文件中查找。这就是我所说的“‘如何制作此类项目’的一般介绍”,可能特别适用于 KDE 项目;有类似的东西吗?
答案1
命令的问题find_package(KDE4 REQUIRED)
在我的回答中得到了解决如何获取 KDE4 来在 Ubuntu 12.04 中构建项目?。
类似地,安装zlib1g-dev
使我能够CMakeLists.txt
通过(不带参数)将其作为“Qt 4 Designer”项目打开cmake
并构建它;Qt 接受了源的依赖关系。
我已经实现了我的目标——现在我可以使用调试器观察 Krusader 的工作原理。(对于稳定的 Krusader 版本,类似的步骤导致翻译过程中出现错误消息,显然我犯了一个错误,可能是在某些依赖项的版本上;看到我使用的 Krusader 版本,我感到很满意。)