Commit 307a67b2 authored by Clownce Deng's avatar Clownce Deng

fix: modify dir, change name

parent a3c73dac
...@@ -77,6 +77,8 @@ Thumbs.db ...@@ -77,6 +77,8 @@ Thumbs.db
**/dist/ **/dist/
**/build/ **/build/
**/*.egg-info/
**/build*/
!src/lib/*.qm !src/lib/*.qm
# SINCPM # SINCPM
......
...@@ -3,25 +3,24 @@ import platform ...@@ -3,25 +3,24 @@ import platform
import subprocess import subprocess
import shutil import shutil
from pathlib import Path from pathlib import Path
from setuptools import setup, Extension, find_namespace_packages from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
from PySide6.support.generate_pyi import generate_all_pyi
# ---- PROJECT SETTING ---------- # # ---- PROJECT SETTING ---------- #
NAMESPACE = "timp" PROJECT = "timp_pcbcam"
PROJECT = "pcbcam" LIBNAME = "libpcbcam"
VERSION = "1.0.0" VERSION = "1.0.0"
DESCRIPTION = "pcbcam lib" DESCRIPTION = "timp_pcbcam lib"
# ---- END OF PROJECT SETTING ----# # ---- END OF PROJECT SETTING ----#
class CMakeExtension(Extension): class CMakeExtension(Extension):
""" CMake编译扩展类 """ """ CMake编译扩展类 """
def __init__(self, name: str, namespace: str = "", sourcedir: str = ""): def __init__(self, name: str, libname: str = "", sourcedir: str = ""):
Extension.__init__(self, name, sources=[]) Extension.__init__(self, name, sources=[])
self.namespace = namespace self.libname = libname
self.sourcedir = os.path.abspath(sourcedir) self.sourcedir = os.path.abspath(sourcedir)
...@@ -31,14 +30,10 @@ class CMakeBuild(build_ext): ...@@ -31,14 +30,10 @@ class CMakeBuild(build_ext):
def build_extension(self, ext): def build_extension(self, ext):
# setuptools 打包文件时创建的临时路径 # setuptools 打包文件时创建的临时路径
py_build_dir = Path(os.path.abspath(self.build_lib)) py_build_dir = Path(os.path.abspath(self.build_lib))
if ext.namespace:
py_build_dir = py_build_dir.joinpath(ext.namespace)
py_build_dir = py_build_dir.joinpath(ext.name) py_build_dir = py_build_dir.joinpath(ext.name)
if not py_build_dir.exists():
os.makedirs(py_build_dir)
# c++源码所在路径,在不同系统下使用不同的编译目录 # c++源码所在路径,在不同系统下使用不同的编译目录
build_temp = Path(ext.sourcedir).parent.joinpath('build') build_temp = Path(ext.sourcedir).joinpath('build-' + platform.system())
if not build_temp.exists(): if not build_temp.exists():
os.makedirs(build_temp) os.makedirs(build_temp)
...@@ -61,7 +56,7 @@ class CMakeBuild(build_ext): ...@@ -61,7 +56,7 @@ class CMakeBuild(build_ext):
libray_files = [] libray_files = []
if platform.system() == "Windows": if platform.system() == "Windows":
libray_files.append("{}.pyd".format(ext.name)) libray_files.append("{}.pyd".format(ext.name))
libray_files.append("lib{}.dll".format(ext.name)) libray_files.append("{}.dll".format(ext.libname))
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
libray_files.append("{}.so".format(ext.name)) libray_files.append("{}.so".format(ext.name))
libray_files.append("lib{}.dylib".format(ext.name)) libray_files.append("lib{}.dylib".format(ext.name))
...@@ -70,7 +65,7 @@ class CMakeBuild(build_ext): ...@@ -70,7 +65,7 @@ class CMakeBuild(build_ext):
libray_files.append("lib{}.so".format(ext.name)) libray_files.append("lib{}.so".format(ext.name))
print('copying dynamic library file') print('copying dynamic library file')
# pak_dir = Path(ext.sourcedir).parent.joinpath(ext.namespace, ext.name) # pak_dir = Path(ext.sourcedir).parent.joinpath(ext.name)
for lib in libray_files: for lib in libray_files:
src_file = build_temp.joinpath(lib) src_file = build_temp.joinpath(lib)
print(f'copying {src_file} -> {py_build_dir}') print(f'copying {src_file} -> {py_build_dir}')
...@@ -113,16 +108,16 @@ class CMakeBuild(build_ext): ...@@ -113,16 +108,16 @@ class CMakeBuild(build_ext):
setup( setup(
name="{}.{}".format(NAMESPACE, PROJECT), name=PROJECT,
version=VERSION, version=VERSION,
author="toplinker", author="toplinker",
author_email="service@topibd.com", author_email="service@topibd.com",
description=DESCRIPTION, description=DESCRIPTION,
long_description=DESCRIPTION, long_description=DESCRIPTION,
ext_modules=[CMakeExtension(name=PROJECT, namespace=NAMESPACE, sourcedir="lib")], ext_modules=[CMakeExtension(name=PROJECT, libname=LIBNAME, sourcedir="src/cxx")],
cmdclass={"build_ext": CMakeBuild}, cmdclass={"build_ext": CMakeBuild},
package_dir={'': 'build'}, package_dir={'': 'src'},
packages=find_namespace_packages(where='build', include=["{}.{}".format(NAMESPACE, PROJECT)]), packages=find_packages(where='src', include=[PROJECT]),
python_requires='>=3.8', python_requires='>=3.8',
install_requires=[ install_requires=[
'PySide6', 'PySide6',
......
# ==================================== Cmake General =========================================
cmake_minimum_required(VERSION 3.16)
cmake_policy(VERSION 3.16)
# Enable policy to not use RPATH settings for install_name on macOS.
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
# Enable policy to run automoc on generated files.
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# ================================ Project configuration ======================================
# Consider changing the project name to something relevant for you.
project(timppcbcam LANGUAGES CXX)
#set(NAMESPACE timp)
set(CXX_FILES
lib/core/abstractdataio.h
lib/core/attrdefine.cpp
lib/core/common.h
lib/core/config.cpp
lib/core/core.cpp
lib/core/feature.cpp
lib/core/font.cpp
lib/core/fontcharline.cpp
lib/core/job.cpp
lib/core/layer.cpp
lib/core/math.cpp
lib/core/matrixlayer.cpp
lib/core/step.cpp
lib/core/steprepeat.cpp
lib/core/symbol.cpp
lib/core/symbolfactory.cpp
lib/core/util.cpp
lib/parser/drillparser.cpp
lib/parser/gerber274xparser.cpp
lib/parser/odbcomponentparser.cpp
lib/parser/odbedadataparser.cpp
lib/parser/odbfeatureparser.cpp
lib/parser/odbmatrixparser.cpp
lib/parser/parserhelper.cpp
lib/widget/canvas.cpp
lib/widget/popviewwindow.cpp)
set(MODULE_NAMES
pcbcam_featureselectionfilter
pcbcam_attrcompareinfo
pcbcamabstractdataio
pcbcamattrdefine
pcbcam
pcbcamconfig
pcbcamcore
pcbcamfeature
pcbcamfeatureline
pcbcamfeaturepad
pcbcamfeaturearc
pcbcamfeaturetext
pcbcamfeaturebarcode
pcbcamfeaturesurface
pcbcamfeaturepath
pcbcamfeaturecomponent
pcbcamfont
pcbcamfontcharline
pcbcamjob
pcbcamlayer
pcbcammath
pcbcammatrixlayer
pcbcamstep
pcbcamsteprepeat
pcbcamutil
pcbcamsymbol
pcbcamsymbolr
pcbcamsymbols
pcbcamsymbolrect
pcbcamsymbolrectr
pcbcamsymbolrectc
pcbcamsymboloval
pcbcamsymboldi
pcbcamsymboloct
pcbcamsymboldonutr
pcbcamsymboldonuts
pcbcamsymbolhexl
pcbcamsymbolhexs
pcbcamsymbolbfr
pcbcamsymbolbfs
pcbcamsymboltri
pcbcamsymbolovalh
pcbcamsymbolthr
pcbcamsymbolths
pcbcamsymbolsths
pcbcamsymbolstho
pcbcamsymbolsrths
pcbcamsymbolrcths
pcbcamsymbolrctho
pcbcamsymbolel
pcbcamsymbolmoire
pcbcamsymboluser
pcbcamsymbolfactory
pcbcamdrillparser
pcbcamgerber274xparser
pcbcamodbcomponentparser
pcbcamodbedadataparser
pcbcamodbfeatureinfo
pcbcamodbfeatureparser
pcbcamodbmatrixparser
pcbcamparserhelper
pcbcamcanvas
pcbcampopviewwindow
)
set(QT_COMPONENTS Core Gui Widgets Qml Network)
# ================================ General configuration ======================================
foreach(cpnt ${QT_COMPONENTS})
find_package(Qt6 COMPONENTS ${cpnt})
endforeach()
# Set CPP standard to C++11 minimum.
set(CMAKE_CXX_STANDARD 11)
# The wiggly library for which we will create bindings. You can change the name to something
# relevant for your project.
set(cxx_library "lib${PROJECT_NAME}")
# The name of the generated bindings module (as imported in Python). You can change the name
# to something relevant for your project.
set(bindings_library ${PROJECT_NAME})
# The header file with all the types and functions for which bindings will be generated.
# Usually it simply includes other headers of the library you are creating bindings for.
set(wrapped_header ${CMAKE_SOURCE_DIR}/bindings.h)
# The typesystem xml file which defines the relationships between the C++ types / functions
# and the corresponding Python equivalents.
set(typesystem_file ${CMAKE_SOURCE_DIR}/bindings.xml)
# Specify which C++ files will be generated by shiboken. This includes the module wrapper
# and a '.cpp' file per C++ type. These are needed for generating the module shared
# library.
set(generated_sources ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${PROJECT_NAME}_module_wrapper.cpp)
foreach(mod ${MODULE_NAMES})
list(APPEND generated_sources "${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${mod}_wrapper.cpp")
endforeach()
# ================================== Shiboken detection ======================================
# Use provided python interpreter if given.
if(NOT python_interpreter)
find_program(python_interpreter "python")
endif()
message(STATUS "Using python interpreter: ${python_interpreter}")
# Macro to get various pyside / python include / link flags and paths.
# Uses the not entirely supported utils/pyside_config.py file.
macro(pyside_config option output_var)
if(${ARGC} GREATER 2)
set(is_list ${ARGV2})
else()
set(is_list "")
endif()
execute_process(
COMMAND ${python_interpreter} "${CMAKE_SOURCE_DIR}/pyside_config.py"
${option}
OUTPUT_VARIABLE ${output_var}
OUTPUT_STRIP_TRAILING_WHITESPACE)
if ("${${output_var}}" STREQUAL "")
message(FATAL_ERROR "Error: Calling pyside_config.py ${option} returned no output.")
endif()
if(is_list)
string (REPLACE " " ";" ${output_var} "${${output_var}}")
endif()
endmacro()
# Query for the shiboken generator path, Python path, include paths and linker flags.
pyside_config(--shiboken-module-path shiboken_module_path)
pyside_config(--shiboken-generator-path shiboken_generator_path)
pyside_config(--pyside-path pyside_path)
pyside_config(--pyside-include-path pyside_include_dir 1)
pyside_config(--python-include-path python_include_dir)
pyside_config(--shiboken-generator-include-path shiboken_include_dir 1)
pyside_config(--shiboken-module-shared-libraries-cmake shiboken_shared_libraries 0)
pyside_config(--python-link-flags-cmake python_linking_data 0)
pyside_config(--pyside-shared-libraries-cmake pyside_shared_libraries 0)
set(shiboken_path "${shiboken_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}")
if(NOT EXISTS ${shiboken_path})
message(FATAL_ERROR "Shiboken executable not found at path: ${shiboken_path}")
endif()
# ==================================== RPATH configuration ====================================
# =============================================================================================
# !!! (The section below is deployment related, so in a real world application you will want to
# take care of this properly with some custom script or tool).
# =============================================================================================
# Enable rpaths so that the built shared libraries find their dependencies.
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH ${shiboken_module_path} ${CMAKE_CURRENT_SOURCE_DIR})
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path")
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# =============================================================================================
# !!! End of dubious section.
# =============================================================================================
# =============================== CMake target - cxx_library ===============================
# Get the relevant Qt include dirs, to pass them on to shiboken.
set(INCLUDES "")
foreach(cpnt ${QT_COMPONENTS})
get_property(QT_${cpnt}_INCLUDE_DIRS TARGET Qt6::${cpnt} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
foreach(INCLUDE_DIR ${QT_${cpnt}_INCLUDE_DIRS})
list(APPEND INCLUDES "-I${INCLUDE_DIR}")
endforeach()
endforeach()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
get_target_property(QtCore_is_framework Qt6::Core FRAMEWORK)
if (QtCore_is_framework)
get_target_property(qt_core_library_location Qt6::Core LOCATION)
get_filename_component(qt_core_library_location_dir "${qt_core_library_location}" DIRECTORY)
get_filename_component(lib_dir "${qt_core_library_location_dir}/../../../" ABSOLUTE)
list(APPEND INCLUDES "--framework-include-paths=${lib_dir}")
endif()
# We need to include the headers for the module bindings that we use.
set(pyside_additional_includes "")
foreach(INCLUDE_DIR ${pyside_include_dir})
foreach(cpnt ${QT_COMPONENTS})
list(APPEND pyside_additional_includes "${INCLUDE_DIR}/Qt${cpnt}")
endforeach()
endforeach()
# Define the wiggly shared library for which we will create bindings.
set(${cxx_library}_sources ${CXX_FILES})
add_library(${cxx_library} SHARED ${${cxx_library}_sources})
set_property(TARGET ${cxx_library} PROPERTY PREFIX "")
# Needed mostly on Windows to export symbols, and create a .lib file, otherwise the binding
# library can't link to the wiggly library.
target_compile_definitions(${cxx_library} PRIVATE BINDINGS_BUILD)
# ====================== Shiboken target for generating binding C++ files ====================
# Set up the options to pass to shiboken.
set(shiboken_options --generator-set=shiboken --enable-parent-ctor-heuristic
--enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero
--avoid-protected-hack
${INCLUDES}
-I${CMAKE_SOURCE_DIR}
-T${CMAKE_SOURCE_DIR}
-T${pyside_path}/typesystems
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
)
set(generated_sources_dependencies ${wrapped_header} ${typesystem_file})
# Add custom target to run shiboken to generate the binding cpp files.
add_custom_command(OUTPUT ${generated_sources}
COMMAND ${shiboken_path}
${shiboken_options} ${wrapped_header} ${typesystem_file}
DEPENDS ${generated_sources_dependencies}
#IMPLICIT_DEPENDS CXX ${wrapped_header}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Running generator for ${typesystem_file}.")
# =============================== CMake target - bindings_library =============================
# Set the cpp files which will be used for the bindings library.
set(${bindings_library}_sources ${generated_sources})
# Define and build the bindings library.
add_library(${bindings_library} SHARED ${${bindings_library}_sources})
# Apply relevant include and link flags.
target_include_directories(${bindings_library} PRIVATE ${pyside_additional_includes})
target_include_directories(${bindings_library} PRIVATE ${pyside_include_dir})
target_include_directories(${bindings_library} PRIVATE ${python_include_dir})
target_include_directories(${bindings_library} PRIVATE ${shiboken_include_dir})
foreach(cpnt ${QT_COMPONENTS})
target_link_libraries(${cxx_library} PRIVATE Qt6::${cpnt})
target_link_libraries(${bindings_library} PRIVATE Qt6::${cpnt})
endforeach()
target_link_libraries(${bindings_library} PRIVATE ${cxx_library})
target_link_libraries(${bindings_library} PRIVATE ${pyside_shared_libraries})
target_link_libraries(${bindings_library} PRIVATE ${shiboken_shared_libraries})
# Adjust the name of generated module.
set_property(TARGET ${bindings_library} PROPERTY PREFIX "")
set_property(TARGET ${bindings_library} PROPERTY OUTPUT_NAME
"${bindings_library}${PYTHON_EXTENSION_SUFFIX}")
if(WIN32)
set_property(TARGET ${bindings_library} PROPERTY SUFFIX ".pyd")
elseif(APPLE)
set_property(TARGET ${bindings_library} PROPERTY SUFFIX ".so")
endif()
# Make sure the linker doesn't complain about not finding Python symbols on macOS.
if(APPLE)
set_target_properties(${bindings_library} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(APPLE)
# Find and link to the python import library only on Windows.
# On Linux and macOS, the undefined symbols will get resolved by the dynamic linker
# (the symbols will be picked up in the Python executable).
if (WIN32)
list(GET python_linking_data 0 python_libdir)
list(GET python_linking_data 1 python_lib)
message("python_libdir = ${python_libdir}")
find_library(python_link_flags ${python_lib} PATHS ${python_libdir} HINTS ${python_libdir})
target_link_libraries(${bindings_library} PRIVATE ${python_link_flags})
endif()
# ================================= Dubious deployment section ================================
set(windows_shiboken_shared_libraries)
if(WIN32)
# =========================================================================================
# !!! (The section below is deployment related, so in a real world application you will want to take care of this properly (this is simply to eliminate errors that users usually encounter.
# =========================================================================================
# Circumvent some "#pragma comment(lib)"s in "include/pyconfig.h" which might force to link
# against a wrong python shared library.
set(python_versions_list 3 36 37 38 39)
set(python_additional_link_flags "")
foreach(ver ${python_versions_list})
set(python_additional_link_flags
"${python_additional_link_flags} /NODEFAULTLIB:\"python${ver}_d.lib\"")
set(python_additional_link_flags
"${python_additional_link_flags} /NODEFAULTLIB:\"python${ver}.lib\"")
endforeach()
set_target_properties(${bindings_library}
PROPERTIES LINK_FLAGS "${python_additional_link_flags}")
# Compile a list of shiboken shared libraries to be installed, so that
# the user doesn't have to set the PATH manually to point to the PySide package.
foreach(library_path ${shiboken_shared_libraries})
string(REGEX REPLACE ".lib$" ".dll" library_path ${library_path})
file(TO_CMAKE_PATH ${library_path} library_path)
list(APPEND windows_shiboken_shared_libraries "${library_path}")
endforeach()
# =========================================================================================
# !!! End of dubious section.
# =========================================================================================
endif()
# =============================================================================================
# !!! (The section below is deployment related, so in a real world application you will want to
# take care of this properly with some custom script or tool).
# =============================================================================================
# Install the library and the bindings module into the source folder near the main.py file, so
# that the Python interpeter successfully imports the used module.
install(TARGETS ${bindings_library} ${cxx_library}
LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library}
RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library}
)
install(FILES ${windows_shiboken_shared_libraries} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library})
# =============================================================================================
# !!! End of dubious section.
# =============================================================================================
...@@ -12,7 +12,7 @@ if(POLICY CMP0071) ...@@ -12,7 +12,7 @@ if(POLICY CMP0071)
endif() endif()
# Consider changing the project name to something relevant for you. # Consider changing the project name to something relevant for you.
project(pcbcam LANGUAGES CXX) project(timp_pcbcam LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
# find_package(Qt6 6.2.1 REQUIRED COMPONENTS Core Gui Widgets Qml) # find_package(Qt6 6.2.1 REQUIRED COMPONENTS Core Gui Widgets Qml)
...@@ -33,7 +33,7 @@ set(project_library "libpcbcam") ...@@ -33,7 +33,7 @@ set(project_library "libpcbcam")
# The name of the generated bindings module (as imported in Python). You can change the name # The name of the generated bindings module (as imported in Python). You can change the name
# to something relevant for your project. # to something relevant for your project.
set(bindings_library "pcbcam") set(bindings_library "timp_pcbcam")
# The header file with all the types and functions for which bindings will be generated. # The header file with all the types and functions for which bindings will be generated.
# Usually it simply includes other headers of the library you are creating bindings for. # Usually it simply includes other headers of the library you are creating bindings for.
...@@ -46,72 +46,71 @@ set(typesystem_file ${CMAKE_SOURCE_DIR}/bindings.xml) ...@@ -46,72 +46,71 @@ set(typesystem_file ${CMAKE_SOURCE_DIR}/bindings.xml)
# Specify which C++ files will be generated by shiboken. This includes the module wrapper # Specify which C++ files will be generated by shiboken. This includes the module wrapper
# and a '.cpp' file per C++ type. These are needed for generating the module shared # and a '.cpp' file per C++ type. These are needed for generating the module shared
# library. # library.
set(name_space "")
set(generated_sources set(generated_sources
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcam_module_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/timp_pcbcam_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamabstractdataio_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamabstractdataio_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamattrdefine_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamattrdefine_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcam_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcam_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcam_featureselectionfilter_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcam_featureselectionfilter_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcam_attrcompareinfo_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcam_attrcompareinfo_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamconfig_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamconfig_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamcore_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamcore_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeature_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeature_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeatureline_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeatureline_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturepad_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturepad_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturearc_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturearc_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturetext_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturetext_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturebarcode_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturebarcode_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturesurface_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturesurface_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturepath_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturepath_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfeaturecomponent_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfeaturecomponent_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfont_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfont_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamfontcharline_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamfontcharline_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamjob_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamjob_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamlayer_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamlayer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcammath_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcammath_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcammatrixlayer_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcammatrixlayer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamstep_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamstep_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsteprepeat_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsteprepeat_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbol_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbol_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolr_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolr_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbols_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbols_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolrect_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolrect_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolrectr_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolrectr_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolrectc_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolrectc_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboloval_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboloval_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboldi_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboldi_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboloct_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboloct_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboldonutr_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboldonutr_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboldonuts_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboldonuts_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolhexl_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolhexl_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolhexs_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolhexs_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolbfr_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolbfr_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolbfs_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolbfs_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboltri_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboltri_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolovalh_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolovalh_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolthr_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolthr_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolths_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolths_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolsths_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolsths_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolstho_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolstho_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolsrths_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolsrths_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolrcths_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolrcths_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolrctho_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolrctho_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolel_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolel_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolmoire_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolmoire_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymboluser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymboluser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamsymbolfactory_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamsymbolfactory_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamutil_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamutil_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamdrillparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamdrillparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamgerber274xparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamgerber274xparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamodbcomponentparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamodbcomponentparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamodbedadataparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamodbedadataparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamodbfeatureinfo_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamodbfeatureinfo_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamodbfeatureparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamodbfeatureparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamodbmatrixparser_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamodbmatrixparser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamparserhelper_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamparserhelper_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcamcanvas_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcamcanvas_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/${name_space}pcbcampopviewwindow_wrapper.cpp) ${CMAKE_CURRENT_BINARY_DIR}/${bindings_library}/pcbcampopviewwindow_wrapper.cpp)
# ================================== Shiboken detection ====================================== # ================================== Shiboken detection ======================================
...@@ -372,10 +371,10 @@ endif() ...@@ -372,10 +371,10 @@ endif()
# Install the library and the bindings module into the source folder near the main.py file, so # Install the library and the bindings module into the source folder near the main.py file, so
# that the Python interpeter successfully imports the used module. # that the Python interpeter successfully imports the used module.
install(TARGETS ${bindings_library} ${project_library} install(TARGETS ${bindings_library} ${project_library}
LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library}
RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library}
) )
install(FILES ${windows_shiboken_shared_libraries} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}) install(FILES ${windows_shiboken_shared_libraries} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../${bindings_library})
# ============================================================================================= # =============================================================================================
# !!! End of dubious section. # !!! End of dubious section.
# ============================================================================================= # =============================================================================================
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<typesystem package="pcbcam"> <typesystem package="timp_pcbcam">
<load-typesystem name="typesystem_core.xml" generate="no"/> <load-typesystem name="typesystem_core.xml" generate="no"/>
<load-typesystem name="typesystem_gui.xml" generate="no"/> <load-typesystem name="typesystem_gui.xml" generate="no"/>
<load-typesystem name="typesystem_widgets.xml" generate="no"/> <load-typesystem name="typesystem_widgets.xml" generate="no"/>
......
#----------------项目设置---------------------------------------------------- #----------------项目设置----------------------------------------------------
PROJECT_NAME = titan_pcbcam PROJECT_NAME = timp_pcbcam
ROOT_DIR = $$PWD/../ ROOT_DIR = $$PWD/../
HEADER_DIR = titan/pcbcam HEADER_DIR =
DLL_LIBS = DLL_LIBS =
STATIC_LIBS = STATIC_LIBS =
VERSION = 2.0.3 VERSION = 2.0.3
......
...@@ -10,6 +10,7 @@ PYSIDE = 'pyside6' ...@@ -10,6 +10,7 @@ PYSIDE = 'pyside6'
PYSIDE_MODULE = 'PySide6' PYSIDE_MODULE = 'PySide6'
SHIBOKEN = 'shiboken6' SHIBOKEN = 'shiboken6'
class Package(Enum): class Package(Enum):
SHIBOKEN_MODULE = 1 SHIBOKEN_MODULE = 1
SHIBOKEN_GENERATOR = 2 SHIBOKEN_GENERATOR = 2
......
from .timp_pcbcam import *
\ No newline at end of file
from timp.pcbcam import PcbCamUtil as UT import PySide6.QtCore
import PySide6.QtWidgets
from timp_pcbcam import PcbCamUtil as UT
if __name__ == "__main__": if __name__ == "__main__":
a = UT.formatNumber(12.135456789, 2) a = UT.formatNumber(12.135456789, 2)
......
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