diff --git a/CMakeLists.txt b/CMakeLists.txt index 648f89df..589bae91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,9 +26,14 @@ set(ARCHIVE_DEBUILD_FULL_NAME ${CMAKE_PROJECT_NAME}_${VERSION}.orig.tar.xz) set(GLADE_FILES ui/composer.glade ui/login.glade ui/message.glade ui/password-dialog.glade ui/toolbar.glade) +option(DEBUG "Build for debugging." OFF) option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON) option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON) +if (DEBUG) + message(STATUS "Debug build") +endif () + if (ICON_UPDATE) message(STATUS "Icon cache will be updated") endif () diff --git a/configure b/configure index 002a4f36..29a95cdc 100755 --- a/configure +++ b/configure @@ -20,6 +20,9 @@ configure_help() { printf "\t--prefix=PREFIX\t\tPrepend PREFIX to program installation paths.\n" printf "\t\t\t\t[%s]\n" $DEFAULT_PREFIX + printf "\t--debug\n" + printf "\t\t\t\tBuild for debugging.\n" + printf "\t--disable-schemas-compile\n" printf "\t\t\t\tDisable compiling the GSettings schema.\n" @@ -59,6 +62,10 @@ do CMDLINE="${CMDLINE} -DCMAKE_INSTALL_PREFIX=${value}" ;; + --debug) + CMDLINE="${CMDLINE} -DDEBUG=ON" + ;; + --disable-schemas-compile) CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE=OFF" CMDLINE="${CMDLINE} -DGSETTINGS_COMPILE_IN_PLACE=OFF" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index badb2e2d..9cd32fab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -380,9 +380,15 @@ set(CFLAGS -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLANGUAGE_SUPPORT_DIRECTORY=\"${LANGUAGE_SUPPORT_DIRECTORY}\" -g - -O2 ) +if (NOT DEBUG) + set(CFLAGS + ${CFLAGS} + -O2 + ) +endif () + set(LIB_PATHS ${DEPS_LIBRARY_DIRS}) link_directories(${LIB_PATHS}) add_definitions(${CFLAGS})