[Kst] branches/work/kst/portto4/kst
Peter Kümmel
syntheticpp at gmx.net
Sun Dec 5 12:12:14 CET 2010
SVN commit 1203737 by kuemmel:
cmake: add datasources
M +15 -3 cmake/modules/KstMacros.cmake
M +2 -0 cmake/src/CMakeLists.txt
A cmake/src/datasources (directory)
AM cmake/src/datasources/CMakeLists.txt
M +1 -3 cmake/src/plugins/CMakeLists.txt
M +2 -2 src/datasources/ascii/asciiplugin.h
M +2 -0 src/libkstmath/dataobject.cpp
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1203736:1203737
@@ -31,10 +31,22 @@
endmacro()
+macro(kst_init_plugin dir)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugin)
+ include_directories(${CMAKE_BINARY_DIR}/${dir})
+ kst_include_directories(kstcore kstmath kstwidgets)
+ set(kst_plugin_dir ${dir})
+endmacro()
+
+
macro(kst_add_plugin folder name)
- string(REPLACE / _ _folder_name ${folder})
- kst_init(kstplugin_${_folder_name}_${name})
- kst_files_find(src/plugins/${folder}/${name})
+ set(_name kstplugin_${folder}_${name})
+ string(REPLACE . _ _name ${_name})
+ string(REPLACE / _ _name ${_name})
+ string(REPLACE __ _ _name ${_name})
+ string(REPLACE __ _ _name ${_name})
+ kst_init(${_name})
+ kst_files_find(${kst_plugin_dir}/${folder}/${name})
add_library(${kst_name} SHARED ${kst_${kst_name}_sources} ${kst_${kst_name}_headers})
kst_link(kstcore kstmath kstwidgets)
endmacro()
--- branches/work/kst/portto4/kst/cmake/src/CMakeLists.txt #1203736:1203737
@@ -3,6 +3,8 @@
add_subdirectory(widgets)
add_subdirectory(libkstapp)
add_subdirectory(kst)
+
+add_subdirectory(datasources)
add_subdirectory(plugins)
--- branches/work/kst/portto4/kst/cmake/src/plugins/CMakeLists.txt #1203736:1203737
@@ -1,8 +1,6 @@
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugin)
-include_directories(${CMAKE_BINARY_DIR}/src/plugins)
-kst_include_directories(kstcore kstmath kstwidgets)
+kst_init_plugin(src/plugins)
kst_add_plugin(dataobject bin)
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciiplugin.h #1203736:1203737
@@ -19,8 +19,8 @@
#define ASCII_PLUGIN_H
-#include <asciisource.h>
-#include <dataplugin.h>
+#include "asciisource.h"
+#include "dataplugin.h"
class AsciiPlugin : public QObject, public Kst::DataSourcePluginInterface
--- branches/work/kst/portto4/kst/src/libkstmath/dataobject.cpp #1203736:1203737
@@ -201,12 +201,14 @@
foreach (QString pluginPath, pluginPaths) {
QDir d(pluginPath);
+ Debug::self()->log(i18n("Path: ") + pluginPath);
foreach (QString fileName, d.entryList(QDir::Files)) {
QPluginLoader loader(d.absoluteFilePath(fileName));
QObject *plugin = loader.instance();
if (plugin) {
if (DataObjectPluginInterface *dataObjectPlugin = dynamic_cast<DataObjectPluginInterface*>(plugin)) {
tmpList.append(dataObjectPlugin);
+ Debug::self()->log(i18n("Loaded: ") + fileName);
}
}
}
More information about the Kst
mailing list