Skip to content

Commit c6e6161

Browse files
authored
Plugin config file (#17)
* Use PluginInfo.json * Specify CXX as language in cmake * safer cmake checks * Remove unused cmake definitions
1 parent 63547f7 commit c6e6161

4 files changed

Lines changed: 19 additions & 18 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@ option(MV_UNITY_BUILD "Combine target source files into batches for faster compi
66
# SpectralView Plugin
77
# -----------------------------------------------------------------------------
88
set(SVPLUGIN "SpectralViewPlugin")
9-
10-
PROJECT(${SVPLUGIN})
9+
PROJECT(${SVPLUGIN}
10+
DESCRIPTION "View plugin for ManiVault for spectral data"
11+
LANGUAGES CXX
12+
)
1113

1214
# -----------------------------------------------------------------------------
1315
# CMake Options
1416
# -----------------------------------------------------------------------------
1517
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1618
set(CMAKE_AUTOMOC ON)
1719
set(CMAKE_AUTORCC ON)
18-
set(CMAKE_AUTOUIC ON)
1920

20-
if(MSVC)
21+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
2122
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32 /EHsc /MP /permissive- /Zc:__cplusplus /W3")
2223
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
2324
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
2425
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
25-
endif(MSVC)
26+
endif()
2627

2728
# -----------------------------------------------------------------------------
2829
# Dependencies
@@ -87,7 +88,7 @@ set(WEB
8788

8889
set(AUX
8990
res/lineplot_resources.qrc
90-
src/SpectralViewPlugin.json
91+
PluginInfo.json
9192
)
9293

9394
qt6_add_resources(RESOURCE_FILES res/lineplot_resources.qrc)
@@ -113,7 +114,6 @@ target_include_directories(${SVPLUGIN} PRIVATE "${ManiVault_INCLUDE_DIR}")
113114
# -----------------------------------------------------------------------------
114115
# Target properties
115116
# -----------------------------------------------------------------------------
116-
# Request C++17
117117
target_compile_features(${SVPLUGIN} PRIVATE cxx_std_20)
118118

119119
if(MV_UNITY_BUILD)
@@ -147,16 +147,13 @@ add_custom_command(TARGET ${SVPLUGIN} POST_BUILD
147147
--prefix ${ManiVault_INSTALL_DIR}/$<CONFIGURATION>
148148
)
149149

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

155152
# -----------------------------------------------------------------------------
156153
# Miscellaneous
157154
# -----------------------------------------------------------------------------
158155
# Automatically set the debug environment (command + working directory) for MSVC in debug mode
159-
if(MSVC)
156+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
160157
set_property(TARGET ${SVPLUGIN} 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 ${SVPLUGIN} 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" : "Spectral View",
3+
"version" : {
4+
"plugin" : "1.0.0",
5+
"core" : ["1.3"]
6+
},
7+
"type" : "View",
8+
"dependencies" : ["Points", "Cluster", "Images"]
9+
}

src/SpectralViewPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class SpectralViewPluginFactory : public ViewPluginFactory
130130
Q_INTERFACES(mv::plugin::ViewPluginFactory mv::plugin::PluginFactory)
131131
Q_OBJECT
132132
Q_PLUGIN_METADATA(IID "nl.tudelft.SpectralViewPlugin"
133-
FILE "SpectralViewPlugin.json")
133+
FILE "PluginInfo.json")
134134

135135
public:
136136
SpectralViewPluginFactory();

src/SpectralViewPlugin.json

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

0 commit comments

Comments
 (0)