From 09c4484241bc184b23eb3a9d7d3296095ecc4a2e Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Fri, 20 Jul 2007 13:34:42 +0200 Subject: [PATCH] Added debug definition to the build system. --- CMakeLists.txt | 1 + data/pics/CMakeLists.txt | 2 +- src/main.cpp | 11 +++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce40172..6a96f77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ ADD_DEFINITIONS(-fexceptions) find_package(KDE4 REQUIRED) include(KDE4Defaults) +set(CMAKE_CXX_FLAGS_DEBUGFULL "${CMAKE_C_FLAGS_DEBUGFULL} -DTAGUA_DEBUG") add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) add_subdirectory(src) diff --git a/data/pics/CMakeLists.txt b/data/pics/CMakeLists.txt index 633c27c..506aa70 100644 --- a/data/pics/CMakeLists.txt +++ b/data/pics/CMakeLists.txt @@ -10,5 +10,5 @@ install(FILES promoteQueen.png promoteRook.png tagua.svg -DESTINATION ${DATA_INSTALL_DIR}/tagua/pictures) +DESTINATION ${DATA_INSTALL_DIR}/tagua/pics) diff --git a/src/main.cpp b/src/main.cpp index 2c18352..687b463 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,15 +46,22 @@ int main(int argc, char **argv) { KCmdLineArgs::addCmdLineOptions(options); KApplication app; +#ifdef TAGUA_DEBUG + // So you can attach the debugger in case of segfault. installCrashHander(); atexit(trap); + // If we are debugging, it is handy to have a local data + // directory which is accessed by Tagua, so we don't need + // to reconfigure / reinstall whenever a change is made in + // a theme. QString data_dir = qgetenv("TAGUA_DATA"); if (data_dir.isEmpty()) data_dir = "data"; - KGlobal::dirs()->addResourceDir("appdata", data_dir); - KGlobal::dirs()->addResourceDir("icon", data_dir + "/pics"); + KGlobal::dirs()->addResourceDir("appdata", data_dir, true); + KGlobal::dirs()->addResourceDir("icon", data_dir + "/pics", true); KIconLoader::global()->reconfigure(about.appName(), KGlobal::dirs()); +#endif // KBOARD_DEBUG MainWindow* widget = new MainWindow; widget->show(); -- 2.11.4.GIT