File tree 4 files changed +28
-7
lines changed
4 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ set(QT_TARGETS_FOLDER autogen)
41
41
42
42
include (${CMAKE_CURRENT_LIST_DIR} /mo2_cpp.cmake)
43
43
include (${CMAKE_CURRENT_LIST_DIR} /mo2_python.cmake)
44
+ include (${CMAKE_CURRENT_LIST_DIR} /mo2_extension.cmake)
44
45
45
46
# mark as included
46
47
set (MO2_DEFINED true )
Original file line number Diff line number Diff line change @@ -327,12 +327,7 @@ endfunction()
327
327
function (mo2_install_plugin TARGET )
328
328
cmake_parse_arguments (MO2 "FOLDER" "" "" ${ARGN} )
329
329
330
- if (${MO2_FOLDER} )
331
- install (TARGETS ${TARGET} RUNTIME DESTINATION ${MO2_INSTALL_BIN} /plugins/$<TARGET_FILE_BASE_NAME:${TARGET} >)
332
- else ()
333
- install (TARGETS ${TARGET} RUNTIME DESTINATION bin/extensions/${CMAKE_PROJECT_NAME} /plugins)
334
- endif ()
335
-
330
+ install (TARGETS ${TARGET} RUNTIME DESTINATION ${MO2_INSTALL_BIN} /extensions/${MO2_EXTENSION_ID} /plugins)
336
331
if (NOT MO2_INSTALL_IS_BIN)
337
332
install (TARGETS ${TARGET} ARCHIVE DESTINATION lib)
338
333
# install PDB if possible
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.16)
2
+
3
+ #! mo2_configure_extension : configure a MO2 extension
4
+ #
5
+ # this function read the extension identifier from the metadata.json file and
6
+ # expose it as a ${extension_identifier} variable
7
+ #
8
+ # this function also trigger the installation of the metadata file to the
9
+ # extension directory
10
+ #
11
+ function (mo2_configure_extension)
12
+ set (METADATA_FILE ${CMAKE_CURRENT_SOURCE_DIR} /metadata.json)
13
+
14
+ if (NOT (EXISTS ${METADATA_FILE} ))
15
+ message (ERROR "metadata file ${METADATA_FILE} not found" )
16
+ endif ()
17
+
18
+ file (READ ${METADATA_FILE} JSON_METADATA)
19
+ string (JSON extension_identifier GET ${JSON_METADATA} id)
20
+
21
+ set (MO2_EXTENSION_ID ${extension_identifier} PARENT_SCOPE)
22
+
23
+ install (FILES ${METADATA_FILE}
24
+ DESTINATION ${MO2_INSTALL_BIN} /extensions/${extension_identifier} /)
25
+ endfunction ()
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ function(mo2_configure_python_module TARGET)
230
230
FILES "${PROJECT_SOURCE_DIR} /plugin-requirements.txt" )
231
231
endif ()
232
232
233
- set (install_dir "${MO2_INSTALL_BIN } /plugins/${TARGET} " )
233
+ set (install_dir "${MO2_INSTALL_PATH} /bin/extensions/ ${MO2_EXTENSION_ID } /plugins/${TARGET} " )
234
234
235
235
# directories that go in bin/plugins/${name}
236
236
install (
You can’t perform that action at this time.
0 commit comments