Author: Pino Toscano <pino@debian.org>
Description: Do not use the structures tool if not compiled in Okteta.
Currently, the structures plugin of Okteta is compiled only on little endian
architectures; this plugin uses it assuming it is always compiled.
Check at cmake time whether the structures tool is available in the found
kasten headers, and if it is not then disable the usage of the structures
tool.
Last-Update: 2012-03-15
Forwarded: no
--- a/utils/okteta/oktetaplugin.cpp
+++ b/utils/okteta/oktetaplugin.cpp
@@ -43,8 +43,10 @@
#include <bytetabletoolfactory.h>
#include <bookmarkstoolviewfactory.h>
#include <bookmarkstoolfactory.h>
+#ifndef OKTETA_NO_STRUCTURES_TOOL
#include <structurestoolviewfactory.h>
#include <structurestoolfactory.h>
+#endif
// KDev
#include <project/projectmodel.h>
#include <interfaces/icore.h>
@@ -94,7 +96,9 @@
addTool( uiController, new Kasten::ByteTableToolViewFactory(), new Kasten::ByteTableToolFactory() );
addTool( uiController, new Kasten::InfoToolViewFactory(), new Kasten::InfoToolFactory() );
addTool( uiController, new Kasten::PodDecoderToolViewFactory(), new Kasten::PodDecoderToolFactory() );
+#ifndef OKTETA_NO_STRUCTURES_TOOL
addTool( uiController, new Kasten::StructuresToolViewFactory(), new Kasten::StructuresToolFactory() );
+#endif
addTool( uiController, new Kasten::BookmarksToolViewFactory, new Kasten::BookmarksToolFactory() );
KDevelop::IDocumentController* documentController = core()->documentController();
--- a/utils/okteta/CMakeLists.txt
+++ b/utils/okteta/CMakeLists.txt
@@ -1,5 +1,6 @@
project( okteta )
+find_file(KASTEN_STRUCTTOOL_H structtool.h PATHS ${LIBKASTEN_INCLUDE_DIR} NO_DEFAULT_PATH)
include_directories( ${okteta_SOURCE_DIR} ${okteta_BINARY_DIR} )
@@ -7,6 +8,10 @@
-DKASTEN_VERSION=${LIBKASTEN_VERSION}
)
+if(NOT KASTEN_STRUCTTOOL_H)
+ add_definitions(-DOKTETA_NO_STRUCTURES_TOOL)
+endif()
+
include_directories(
${LIBKASTEN_INCLUDE_DIRS}
${LIBOKTETA_INCLUDE_DIRS}