Skip to content

Commit 593673a

Browse files
authored
Plugin config file (#176)
* Rename and move config json file * We use automoc * Add core version to PluginInfo.json * Read plugin version from config file * Set cmake project version to plugin version * Encore plugin and manivault version in output file name * More robust compiler check * Bundle plugin and core version * Add optional plugin type to config file * Read optional plugin type from config file * Move meta data handling to core * Remove duplicate member
1 parent fc216ee commit 593673a

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

CMakeLists.txt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ option(MV_UNITY_BUILD "Combine target source files into batches for faster compi
66
# Scatterplot Plugin
77
# -----------------------------------------------------------------------------
88
set(PROJECT "ScatterplotPlugin")
9-
PROJECT(${PROJECT})
9+
10+
PROJECT(${PROJECT}
11+
DESCRIPTION "A scatterplot viewer plugin for ManiVault"
12+
LANGUAGES CXX
13+
)
1014

1115
# -----------------------------------------------------------------------------
1216
# CMake Options
@@ -16,12 +20,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
1620
set(CMAKE_AUTORCC ON)
1721
set(CMAKE_AUTOMOC ON)
1822

19-
if(MSVC)
23+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
2024
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32 /EHsc /MP /permissive- /Zc:__cplusplus")
2125
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
2226
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
2327
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
24-
endif(MSVC)
28+
endif()
2529

2630
# -----------------------------------------------------------------------------
2731
# Dependencies
@@ -38,10 +42,6 @@ set(PLUGIN
3842
src/ScatterplotPlugin.cpp
3943
)
4044

41-
set(PLUGIN_MOC_HEADERS
42-
src/ScatterplotPlugin.h
43-
)
44-
4545
set(UI
4646
src/ScatterplotWidget.h
4747
src/ScatterplotWidget.cpp
@@ -88,7 +88,7 @@ set(Models
8888
)
8989

9090
set(AUX
91-
src/ScatterplotPlugin.json
91+
PluginInfo.json
9292
)
9393

9494
set(SOURCES ${PLUGIN} ${UI} ${Actions} ${Models})
@@ -147,16 +147,13 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD
147147
--prefix ${ManiVault_INSTALL_DIR}/$<CONFIGURATION>
148148
)
149149

150-
set_target_properties(${PROJECT}
151-
PROPERTIES
152-
FOLDER ViewPlugins
153-
)
150+
mv_handle_plugin_config(${PROJECT})
154151

155152
# -----------------------------------------------------------------------------
156153
# Miscellaneous
157154
# -----------------------------------------------------------------------------
158155
# Automatically set the debug environment (command + working directory) for MSVC
159-
if(MSVC)
156+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
160157
set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/Debug,$<IF:$<CONFIG:RELWITHDEBINFO>,${ManiVault_INSTALL_DIR}/RelWithDebInfo,${ManiVault_INSTALL_DIR}/Release>>)
161158
set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $<IF:$<CONFIG:DEBUG>,"${ManiVault_INSTALL_DIR}/Debug/ManiVault Studio.exe",$<IF:$<CONFIG:RELWITHDEBINFO>,"${ManiVault_INSTALL_DIR}/RelWithDebInfo/ManiVault Studio.exe","${ManiVault_INSTALL_DIR}/Release/ManiVault Studio.exe">>)
162159
endif()

PluginInfo.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name" : "Scatterplot View",
3+
"version" : {
4+
"plugin" : "1.0.0",
5+
"core" : ["1.3"]
6+
},
7+
"type" : "Viewer",
8+
"dependencies" : ["Points"]
9+
}

src/ScatterplotPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class ScatterplotPluginFactory : public ViewPluginFactory
132132
Q_INTERFACES(mv::plugin::ViewPluginFactory mv::plugin::PluginFactory)
133133
Q_OBJECT
134134
Q_PLUGIN_METADATA(IID "studio.manivault.ScatterplotPlugin"
135-
FILE "ScatterplotPlugin.json")
135+
FILE "PluginInfo.json")
136136

137137
public:
138138
ScatterplotPluginFactory();

src/ScatterplotPlugin.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)