Skip to content

Commit

Permalink
mabiderun
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Sep 5, 2022
1 parent e37f399 commit 5783014
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
cuda: 11.7.1
visual_studio: "Visual Studio 16 2019"
shell: powershell
run:
run: |
.\misc\ci\win\install_cuda_windows.ps1
ls $env:CUDA_PATH\
ls $env:CUDA_PATH\bin
Expand Down
10 changes: 10 additions & 0 deletions misc/ci/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

if sys.platform == 'win32':
shutil.copytree(os.path.join('misc', 'ci', 'win'), outpath)
extra_lib_dir = os.path.join('projects', 'FBX', 'dem-bones-bin', 'files', 'Windows')
if os.path.isdir(extra_lib_dir):
for dirname, dirnames, filenames in os.walk(extra_lib_dir):
for name in filenames:
shutil.copyfile(os.path.join(dirname, name), os.path.join(outpath, name))
shutil.move(os.path.join(binpath, 'zenoedit.exe'), os.path.join(outpath, 'zenoedit.exe'))
for target in os.listdir(binpath):
if target.endswith('.dll'):
Expand All @@ -33,6 +38,11 @@
print('finished with', outpath + '.zip')
elif sys.platform == 'linux':
shutil.copytree(os.path.join('misc', 'ci', 'nix'), outpath)
extra_lib_dir = os.path.join('projects', 'FBX', 'dem-bones-bin', 'files', 'Linux')
if os.path.isdir(extra_lib_dir):
for dirname, dirnames, filenames in os.walk(extra_lib_dir):
for name in filenames:
shutil.copyfile(os.path.join(dirname, name), os.path.join(outpath, name))
subprocess.check_call([
'wget',
'https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage',
Expand Down
Binary file removed misc/ci/win/libomp140.x86_64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion projects/FBX/dem-bones-bin
7 changes: 5 additions & 2 deletions projects/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ endif()
file(GLOB_RECURSE sources CONFIGURE_DEPENDS *.cpp *.h)
target_sources(zeno PRIVATE ${sources})

set(ZENO_PYTHON_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Lib)
set(ZENO_PYTHON_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Lib)
set(ZENO_PYTHON_HOME_DIR ${CMAKE_CURRENT_BINARY_DIR}/CPython)
set(ZENO_PYTHON_LIB_DIR ${ZENO_PYTHON_HOME_DIR}/lib)
set(ZENO_PYTHON_BIN_DIR ${ZENO_PYTHON_HOME_DIR}/bin)
if (WIN32)
set(ZENO_PYTHON_DLL_FILE zeno.dll)
elseif (APPLE)
Expand All @@ -16,8 +18,9 @@ else()
endif()
configure_file(zeno_Python_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/confinc/zeno_Python_config.h @ONLY)
target_include_directories(zeno PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/confinc)
zeno_add_asset_dir(${ZENO_PYTHON_MODULE_DIR})
zeno_add_asset_dir(${ZENO_PYTHON_LIB_DIR})
zeno_add_asset_dir(${ZENO_PYTHON_HOME_DIR})
zeno_add_asset_dir(${ZENO_PYTHON_BIN_DIR})

set(BUILD_LIBPYTHON_SHARED OFF CACHE BOOL "ZENOCIHOUPYTHON" FORCE)
set(BUILD_EXTENSIONS_AS_BUILTIN ON CACHE BOOL "ZENOCIHOUPYTHON" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion projects/Python/PythonNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static int defPythonInit = getSession().eventCallbacks->hookEvent("init", [] {
ws.resize(std::mbstowcs(ws.data(), s.data(), s.size())); // Shrink to fit.
Py_SetPythonHome(ws.c_str());
Py_Initialize();
std::string libpath = getAssetDir(ZENO_PYTHON_LIB_DIR);
std::string libpath = getAssetDir(ZENO_PYTHON_MODULE_DIR);
std::string dllfile = ZENO_PYTHON_DLL_FILE;
if (PyRun_SimpleString(("__import__('sys').path.insert(0, '" + libpath + "'); import ze; ze.initDLLPath('" + dllfile + "')").c_str()) < 0) {
log_warn("Failed to initialize Python module");
Expand Down
4 changes: 3 additions & 1 deletion projects/Python/zeno_Python_config.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#define ZENO_PYTHON_LIB_DIR "@ZENO_PYTHON_LIB_DIR@"
#define ZENO_PYTHON_MODULE_DIR "@ZENO_PYTHON_MODULE_DIR@"
#define ZENO_PYTHON_HOME_DIR "@ZENO_PYTHON_HOME_DIR@"
#define ZENO_PYTHON_LIB_DIR "@ZENO_PYTHON_LIB_DIR@"
#define ZENO_PYTHON_BIN_DIR "@ZENO_PYTHON_LIB_DIR@"
#define ZENO_PYTHON_DLL_FILE "@ZENO_PYTHON_DLL_FILE@"

0 comments on commit 5783014

Please sign in to comment.