Commit a3c73dac authored by Clownce Deng's avatar Clownce Deng

fix: setup

parent 54deeadd
......@@ -13,7 +13,6 @@ NAMESPACE = "timp"
PROJECT = "pcbcam"
VERSION = "1.0.0"
DESCRIPTION = "pcbcam lib"
# ---- END OF PROJECT SETTING ----#
......@@ -35,9 +34,11 @@ class CMakeBuild(build_ext):
if ext.namespace:
py_build_dir = py_build_dir.joinpath(ext.namespace)
py_build_dir = py_build_dir.joinpath(ext.name)
if not py_build_dir.exists():
os.makedirs(py_build_dir)
# c++源码所在路径,在不同系统下使用不同的编译目录
build_temp = Path(ext.sourcedir).joinpath('../build')
build_temp = Path(ext.sourcedir).parent.joinpath('build')
if not build_temp.exists():
os.makedirs(build_temp)
......@@ -57,23 +58,23 @@ class CMakeBuild(build_ext):
subprocess.check_call(['ninja', 'install'], cwd=build_temp)
# 拷贝动态库至打包目录
# libray_files = []
# if platform.system() == "Windows":
# libray_files.append("{}.pyd".format(ext.name))
# libray_files.append("lib{}.dll".format(ext.name))
# elif platform.system() == "Darwin":
# libray_files.append("{}.so".format(ext.name))
# libray_files.append("lib{}.dylib".format(ext.name))
# else:
# libray_files.append("{}.so".format(ext.name))
# libray_files.append("lib{}.so".format(ext.name))
# print('copying dynamic library file')
libray_files = []
if platform.system() == "Windows":
libray_files.append("{}.pyd".format(ext.name))
libray_files.append("lib{}.dll".format(ext.name))
elif platform.system() == "Darwin":
libray_files.append("{}.so".format(ext.name))
libray_files.append("lib{}.dylib".format(ext.name))
else:
libray_files.append("{}.so".format(ext.name))
libray_files.append("lib{}.so".format(ext.name))
print('copying dynamic library file')
# pak_dir = Path(ext.sourcedir).parent.joinpath(ext.namespace, ext.name)
# for lib in libray_files:
# src_file = pak_dir.joinpath(lib)
# print(f'copying {src_file} -> {py_build_dir}')
# shutil.copy(src_file, py_build_dir)
for lib in libray_files:
src_file = build_temp.joinpath(lib)
print(f'copying {src_file} -> {py_build_dir}')
shutil.copy(src_file, py_build_dir)
def get_qt_dir(self) -> str:
""" 获取QT路径 """
......@@ -135,5 +136,5 @@ setup(
tests_require=[],
extras_require={},
dependency_links=["http://nexus.topibd.net/repository/pypi-public/simple"],
zip_safe=False,
zip_safe=False
)
from timp.pcbcam import PcbCamUtil as UT
if __name__ == "__main__":
a = UT.formatNumber(12.135456789, 2)
print(a)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment