obs-scripting: Update CMakeLists.txt for scripting modules

This commit is contained in:
PatTheMav
2022-02-14 18:46:40 +01:00
parent dba1041034
commit dbdf5c7f7a
9 changed files with 379 additions and 387 deletions

View File

@@ -1671,17 +1671,24 @@ bool obs_scripting_load_python(const char *python_path)
/* ---------------------------------------------- */
/* Load main interface module */
#ifdef __APPLE__
struct dstr bundle_path;
dstr_init_move_array(&bundle_path, os_get_executable_path_ptr(""));
dstr_cat(&bundle_path, "../PlugIns");
char *absolute_plugin_path = os_get_abs_path_ptr(bundle_path.array);
if(absolute_plugin_path != NULL) {
add_to_python_path(absolute_plugin_path);
bfree(absolute_plugin_path);
}
dstr_free(&bundle_path);
#endif
char *absolute_script_path = os_get_abs_path_ptr(SCRIPT_DIR);
add_to_python_path(absolute_script_path);
bfree(absolute_script_path);
#if __APPLE__
char *exec_path = os_get_executable_path_ptr("");
if (exec_path)
add_to_python_path(exec_path);
bfree(exec_path);
#endif
py_obspython = PyImport_ImportModule("obspython");
bool success = !py_error();
if (!success) {