mirror of
https://github.com/ModOrganizer2/cmake_common.git
synced 2026-07-27 14:06:46 -07:00
Fix installation of Python plugins.
This commit is contained in:
+15
-15
@@ -145,10 +145,10 @@ function(mo2_python_uifiles TARGET)
|
||||
|
||||
endfunction()
|
||||
|
||||
#! mo2_python_requirements : install requirements for a python target
|
||||
#! mo2_python_requirements : create requirements for a python target
|
||||
#
|
||||
# \param:TARGET target to install requirements for
|
||||
# \param:LIBDIR library to install requirements to
|
||||
# \param:TARGET target to create requirements for
|
||||
# \param:LIBDIR folder to install requirements to
|
||||
#
|
||||
function(mo2_python_requirements TARGET)
|
||||
cmake_parse_arguments(MO2 "" "LIBDIR" "" ${ARGN})
|
||||
@@ -173,12 +173,6 @@ function(mo2_python_requirements TARGET)
|
||||
|
||||
file(MAKE_DIRECTORY "${MO2_LIBDIR}")
|
||||
|
||||
install(
|
||||
DIRECTORY "${MO2_LIBDIR}"
|
||||
DESTINATION "${MO2_INSTALL_BIN}/plugins/${TARGET}/"
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
#! mo2_configure_python_module : configure a Python plugin module
|
||||
@@ -220,6 +214,8 @@ function(mo2_configure_python_module TARGET)
|
||||
file(GLOB_RECURSE ui_files CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.ui)
|
||||
mo2_python_uifiles(${TARGET} INPLACE FILES ${ui_files})
|
||||
|
||||
set(install_dir "${MO2_INSTALL_BIN}/extensions/${MO2_EXTENSION_ID}")
|
||||
|
||||
# install requirements if there are any
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/plugin-requirements.txt")
|
||||
mo2_python_requirements(${TARGET} LIBDIR "${lib_dir}")
|
||||
@@ -228,14 +224,18 @@ function(mo2_configure_python_module TARGET)
|
||||
)
|
||||
source_group(requirements
|
||||
FILES "${PROJECT_SOURCE_DIR}/plugin-requirements.txt")
|
||||
endif()
|
||||
|
||||
set(install_dir "${MO2_INSTALL_PATH}/bin/extensions/${MO2_EXTENSION_ID}/plugins/${TARGET}")
|
||||
install(
|
||||
DIRECTORY "${MO2_LIBDIR}/"
|
||||
DESTINATION "${install_dir}/lib/"
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
)
|
||||
endif()
|
||||
|
||||
# directories that go in bin/plugins/${name}
|
||||
install(
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
|
||||
DESTINATION ${install_dir}
|
||||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}/"
|
||||
DESTINATION "${install_dir}/${TARGET}/"
|
||||
FILES_MATCHING PATTERN "*.py"
|
||||
PATTERN ".git" EXCLUDE
|
||||
PATTERN ".github" EXCLUDE
|
||||
@@ -246,8 +246,8 @@ function(mo2_configure_python_module TARGET)
|
||||
# copy the resource directory if it exists
|
||||
if(EXISTS "${res_dir}")
|
||||
install(
|
||||
DIRECTORY "${res_dir}"
|
||||
DESTINATION ${install_dir}
|
||||
DIRECTORY "${res_dir}/"
|
||||
DESTINATION "${install_dir}/res/"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user