新增工程cadproject
This commit is contained in:
commit
9c41e1d91c
20 files changed
+1871
No files matched your search
@@ -0,0 +1,3 @@
|
||||
out/
|
||||
bin/
|
||||
lib/
|
||||
@@ -0,0 +1,4 @@
|
||||
::cmake --build --preset R190
|
||||
cmake --build --preset R230 --config release
|
||||
cmake --build --preset R220 --config release
|
||||
pause
|
||||
@@ -0,0 +1,204 @@
|
||||
# cmake/ThirdPartyDeps.cmake
|
||||
|
||||
message(STATUS ">>> 正在注册全局第三方 INTERFACE 目标...")
|
||||
|
||||
# ==========================================
|
||||
# 内部全局头文件
|
||||
# ==========================================
|
||||
# 定义一个全局的内部接口目标,专门管理公共头文件
|
||||
add_library(ShsGlobalIncludes INTERFACE)
|
||||
target_include_directories(ShsGlobalIncludes INTERFACE
|
||||
"${CMAKE_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
||||
# ==========================================
|
||||
# SQLite3
|
||||
# ==========================================
|
||||
add_library(ThirdParty::SQLite3 UNKNOWN IMPORTED)
|
||||
set_target_properties(ThirdParty::SQLite3 PROPERTIES
|
||||
IMPORTED_LOCATION "sqlite3_x64.lib"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
INTERFACE_LINK_DIRECTORIES "${DEP_LIB_ROOT}/pub"
|
||||
)
|
||||
|
||||
# ==========================================
|
||||
# cURL
|
||||
# ==========================================
|
||||
add_library(ThirdParty_cURL INTERFACE)
|
||||
target_include_directories(ThirdParty_cURL INTERFACE "${DEP_INC_ROOT}/curl")
|
||||
target_link_directories(ThirdParty_cURL INTERFACE "${DEP_LIB_ROOT}/curl/${CMAKE_GENERATOR_TOOLSET}")
|
||||
|
||||
add_library(ThirdParty::cURL ALIAS ThirdParty_cURL)
|
||||
|
||||
# ==========================================
|
||||
# ObjectARX
|
||||
# ==========================================
|
||||
set(CURRENT_ARX_SDK "${CAD_SDK_ROOT}/R${CAD_SDK_VERSION}.${CAD_SDK_SUBVERSION}")
|
||||
|
||||
add_library(ThirdParty_ARX INTERFACE)
|
||||
# 保存 头文件目录 列表
|
||||
set(INC_DIRS
|
||||
"${CURRENT_ARX_SDK}/inc"
|
||||
"${CURRENT_ARX_SDK}/inc-x64"
|
||||
"${CURRENT_ARX_SDK}/utils/amodeler/inc"
|
||||
"${CURRENT_ARX_SDK}/utils/Atil/inc"
|
||||
"${CURRENT_ARX_SDK}/utils/brep/inc"
|
||||
"${CURRENT_ARX_SDK}/utils/HlrApi/inc"
|
||||
)
|
||||
# 保存 lib文件的目录 列表
|
||||
set(LIB_DIRS
|
||||
"${CURRENT_ARX_SDK}/lib-x64"
|
||||
"${CURRENT_ARX_SDK}/utils/amodeler/lib-x64"
|
||||
"${CURRENT_ARX_SDK}/utils/Atil/lib-x64"
|
||||
"${CURRENT_ARX_SDK}/utils/brep/lib-x64"
|
||||
"${CURRENT_ARX_SDK}/utils/HlrApi/lib-x64"
|
||||
)
|
||||
# 需要依赖的库文件
|
||||
set(ARX_LIBS
|
||||
acad.lib
|
||||
accore.lib
|
||||
rxapi.lib
|
||||
acgiapi.lib
|
||||
axdb.lib
|
||||
aecmodeler.lib)
|
||||
|
||||
list(APPEND ARX_LIBS
|
||||
acdb${CAD_SDK_VERSION}.lib
|
||||
acge${CAD_SDK_VERSION}.lib
|
||||
acISMobj${CAD_SDK_VERSION}.lib
|
||||
adui${CAD_SDK_VERSION}.lib
|
||||
acui${CAD_SDK_VERSION}.lib
|
||||
ac1st${CAD_SDK_VERSION}.lib
|
||||
acgex${CAD_SDK_VERSION}.lib
|
||||
acbr${CAD_SDK_VERSION}.lib)
|
||||
|
||||
if (CAD_SDK_VERSION GREATER 19)
|
||||
list(APPEND ARX_LIBS
|
||||
acdrawbridge.lib)
|
||||
endif()
|
||||
|
||||
if (CAD_SDK_VERSION GREATER 23)
|
||||
list(APPEND ARX_LIBS
|
||||
acpal.lib
|
||||
acgeoment.lib)
|
||||
endif()
|
||||
|
||||
# 保存头文件目录列表 (你的 INC_DIRS 保持不变)
|
||||
target_include_directories(ThirdParty_ARX INTERFACE ${INC_DIRS})
|
||||
|
||||
# 保存库文件目录列表 (你的 LIB_DIRS 保持不变)
|
||||
target_link_directories(ThirdParty_ARX INTERFACE ${LIB_DIRS})
|
||||
|
||||
# 🌟 这里的 ARX_LIBS 是个列表,直接扔给 link_libraries 就行了!
|
||||
target_link_libraries(ThirdParty_ARX INTERFACE ${ARX_LIBS})
|
||||
|
||||
# 穿上马甲
|
||||
add_library(ThirdParty::ARX ALIAS ThirdParty_ARX)
|
||||
|
||||
# ==========================================
|
||||
# ZW ZRX
|
||||
# ==========================================
|
||||
set(CURRENT_ZRX_SDK "${CAD_SDK_ROOT}/Z${CAD_SDK_VERSION}")
|
||||
add_library(ThirdParty_ZRX INTERFACE)
|
||||
|
||||
if (CAD_SDK_VERSION LESS 2025)
|
||||
# 保存 头文件目录 列表
|
||||
set(INC_DIRS_Z
|
||||
"${CURRENT_ZRX_SDK}/arxport"
|
||||
"${CURRENT_ZRX_SDK}/arxport/arxport/pal/api"
|
||||
|
||||
"${CURRENT_ZRX_SDK}/inc"
|
||||
"${CURRENT_ZRX_SDK}/inc/arxport/pal/api"
|
||||
|
||||
"${CURRENT_ZRX_SDK}/utils/amodeler/inc"
|
||||
"${CURRENT_ZRX_SDK}/utils/amodeler/arxport"
|
||||
|
||||
"${CURRENT_ZRX_SDK}/utils/ztil/inc"
|
||||
"${CURRENT_ZRX_SDK}/utils/ztil/arxport"
|
||||
|
||||
"${CURRENT_ZRX_SDK}/utils/brep/inc"
|
||||
"${CURRENT_ZRX_SDK}/utils/brep/arxport"
|
||||
|
||||
"${CURRENT_ZRX_SDK}/utils/hlr/inc"
|
||||
"${CURRENT_ZRX_SDK}/utils/hlr/arxport"
|
||||
)
|
||||
# 保存 lib文件的目录 列表
|
||||
set(LIB_DIRS_Z
|
||||
"${CURRENT_ZRX_SDK}/lib-x64"
|
||||
"${CURRENT_ZRX_SDK}/utils/amodeler/lib-x64"
|
||||
"${CURRENT_ZRX_SDK}/utils/ztil/lib-x64"
|
||||
"${CURRENT_ZRX_SDK}/utils/brep/lib-x64"
|
||||
"${CURRENT_ZRX_SDK}/utils/hlr/lib-x64"
|
||||
)
|
||||
else() # 大于2024版本,库文件重新调整,所有依赖都在根目录的arxport下
|
||||
set (ZRX_SDK_ARXPORT "${CURRENT_ZRX_SDK}/arxport")
|
||||
set(INC_DIRS_Z
|
||||
"${ZRX_SDK_ARXPORT}/inc"
|
||||
"${ZRX_SDK_ARXPORT}/inc-x64"
|
||||
|
||||
"${ZRX_SDK_ARXPORT}/utils/amodeler/inc"
|
||||
|
||||
"${ZRX_SDK_ARXPORT}/utils/atil/inc"
|
||||
|
||||
"${ZRX_SDK_ARXPORT}/utils/brep/inc"
|
||||
|
||||
"${ZRX_SDK_ARXPORT}/utils/hlrapi/inc"
|
||||
)
|
||||
# 保存 lib文件的目录 列表
|
||||
set(LIB_DIRS_Z
|
||||
"${ZRX_SDK_ARXPORT}/lib-x64"
|
||||
"${ZRX_SDK_ARXPORT}/utils/amodeler/lib-x64"
|
||||
"${ZRX_SDK_ARXPORT}/utils/atil/lib-x64"
|
||||
"${ZRX_SDK_ARXPORT}/utils/brep/lib-x64"
|
||||
"${ZRX_SDK_ARXPORT}/utils/hlrapi/lib-x64"
|
||||
)
|
||||
endif()
|
||||
# 需要依赖的库文件
|
||||
set(ARX_LIBS_Z
|
||||
ZwBase.lib
|
||||
ZWCAD.lib
|
||||
ZwAuto.lib
|
||||
ZwRx.lib
|
||||
ZwZrx.lib
|
||||
ZwGeometry.lib
|
||||
ZwDatabase.lib
|
||||
ZwDatabaseMgd.lib
|
||||
ZwdUI.lib
|
||||
ZwGs.lib
|
||||
ZwTc.lib
|
||||
ZwUI.lib
|
||||
ZwBrep.lib
|
||||
ZwAECModeler.lib)
|
||||
|
||||
# 保存头文件目录列表 (你的 INC_DIRS 保持不变)
|
||||
target_include_directories(ThirdParty_ZRX INTERFACE ${INC_DIRS_Z})
|
||||
|
||||
# 保存库文件目录列表 (你的 LIB_DIRS 保持不变)
|
||||
target_link_directories(ThirdParty_ZRX INTERFACE ${LIB_DIRS_Z})
|
||||
|
||||
# 🌟 这里的 ARX_LIBS 是个列表,直接扔给 link_libraries 就行了!
|
||||
target_link_libraries(ThirdParty_ZRX INTERFACE ${ARX_LIBS_Z})
|
||||
|
||||
# 穿上马甲
|
||||
add_library(ThirdParty::ZRX ALIAS ThirdParty_ZRX)
|
||||
|
||||
# ==========================================
|
||||
# bitanswer
|
||||
# ==========================================
|
||||
add_library(ThirdParty_BitAnswer INTERFACE)
|
||||
target_link_directories(ThirdParty_BitAnswer INTERFACE "${DEP_LIB_ROOT}/pub")
|
||||
add_library(ThirdParty::BitAnswer ALIAS ThirdParty_BitAnswer)
|
||||
|
||||
# ==========================================
|
||||
# modernGlue
|
||||
# ==========================================
|
||||
add_library(ThirdParty_modernGlue INTERFACE)
|
||||
target_include_directories(ThirdParty_modernGlue INTERFACE "${DEP_INC_ROOT}/modernGlue")
|
||||
add_library(ThirdParty::modernGlue ALIAS ThirdParty_modernGlue)
|
||||
|
||||
# ==========================================
|
||||
# cadOcr
|
||||
# ==========================================
|
||||
add_library(ThirdParty_CadOcr INTERFACE)
|
||||
target_include_directories(ThirdParty_CadOcr INTERFACE "${DEP_INC_ROOT}/cadOcr")
|
||||
add_library(ThirdParty::CadOcr ALIAS ThirdParty_CadOcr)
|
||||
@@ -0,0 +1,296 @@
|
||||
# cmake/functions.cmake
|
||||
|
||||
# 判断时否时中望版本
|
||||
function (IsZWCAD out)
|
||||
if (DEFINED CACHE{ZWCAD})
|
||||
set(${out} TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(${out} FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(apply_arx_definitions TARGET_NAME)
|
||||
if(MSVC)
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
_ALLOW_RTCc_IN_STL
|
||||
_WIN32_IE=0x0600
|
||||
WIN
|
||||
WIN32
|
||||
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1
|
||||
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1
|
||||
_AFXDLL
|
||||
UNICODE
|
||||
_UNICODE
|
||||
#_CRT_STDIO_ISO_WIDE_SPECIFIERS=0
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(apply_arx_optimization TARGET_NAME)
|
||||
if(MSVC)
|
||||
# ==========================================
|
||||
# Debug 配置选项
|
||||
# ==========================================
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:/Od> # 禁用优化 (Optimization: Disabled)
|
||||
$<$<CONFIG:Debug>:/Zi> # 禁用优化 (Optimization: Disabled)
|
||||
$<$<CONFIG:Debug>:/Ob0> # 禁用优化 (Optimization: Disabled)
|
||||
#$<$<CONFIG:Debug>:/RTC1> # 启用快速检查 (BasicRuntimeChecks: EnableFastChecks)
|
||||
#$<$<CONFIG:Debug>:/RTCc> # 较小类型检查 (SmallerTypeCheck: true)
|
||||
)
|
||||
|
||||
# ==========================================
|
||||
# Release 配置选项
|
||||
# ==========================================
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:/O2> # 最大优化速度 (Optimization: MaxSpeed)
|
||||
$<$<CONFIG:Release>:/Ob2> # 任何合适的内联扩展 (InlineFunctionExpansion: AnySuitable)
|
||||
$<$<CONFIG:Release>:/Oi> # 启用内部函数 (IntrinsicFunctions: true)
|
||||
$<$<CONFIG:Release>:/Ot> # 代码速度优先 (FavorSizeOrSpeed: Speed)
|
||||
$<$<CONFIG:Release>:/Oy> # 省略帧指针 (OmitFramePointers: true)[cite: 2]
|
||||
$<$<CONFIG:Release>:/GT> # 纤程安全优化 (EnableFiberSafeOptimizations: true)[cite: 2]
|
||||
)
|
||||
|
||||
# 预处理器宏定义
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:_NDEBUG=1> # 预处理器定义 (PreprocessorDefinitions)[cite: 2]
|
||||
$<$<CONFIG:Release>:NDEBUG=1> # 预处理器定义 (PreprocessorDefinitions)[cite: 2]
|
||||
)
|
||||
|
||||
if (DEFINED(WholeProgramOptimization))
|
||||
# 注意: 这里的 /GL (WholeProgramOptimization) 配合下方的 /LTCG 使用[cite: 2]
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:/GL>
|
||||
)
|
||||
# 链接器选项
|
||||
target_link_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:/LTCG> # 链接时代码生成 (LinkTimeCodeGeneration: UseLinkTimeCodeGeneration)[cite: 2]
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# 简单判断是中望还是ACAD,根据结果来链接相应sdk
|
||||
function (simple_link_cad_sdk
|
||||
TARGET_NAME)
|
||||
|
||||
IsZWCAD(isZW)
|
||||
|
||||
if (isZW)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ThirdParty::ZRX)
|
||||
else()
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ThirdParty::ARX)
|
||||
endif()
|
||||
|
||||
apply_arx_optimization(${TARGET_NAME})
|
||||
apply_arx_definitions(${TARGET_NAME})
|
||||
|
||||
endfunction()
|
||||
|
||||
function (get_sdk_version out)
|
||||
IsZWCAD(isZW)
|
||||
set(VER ${CAD_SDK_VERSION})
|
||||
if (isZW)
|
||||
string(REGEX MATCH "..$" VER "${CAD_SDK_VERSION}")
|
||||
endif()
|
||||
set(${out} ${VER} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# 根据 ZWCAD宏,来判断需要的def文件名称,保存到表_SOURCES 里面
|
||||
function (add_def_file_name
|
||||
_SOURCES
|
||||
_BASE_NAME)
|
||||
|
||||
set (tmp "${${_SOURCES}}")
|
||||
|
||||
IsZWCAD(isZW)
|
||||
|
||||
if (isZW)
|
||||
list(APPEND tmp "${_BASE_NAME}_zrx.def")
|
||||
else()
|
||||
list(APPEND tmp "${_BASE_NAME}.def")
|
||||
endif()
|
||||
|
||||
set(${_SOURCES} "${tmp}" PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
|
||||
# 得到加密类型
|
||||
function(get_encryption_modes
|
||||
_modes)
|
||||
|
||||
set (tmp "${${_modes}}")
|
||||
|
||||
list(APPEND tmp "BAL_REMOTE" "TRIAL_YEAR")
|
||||
|
||||
set(${_modes} "${tmp}" PARENT_SCOPE)
|
||||
|
||||
endfunction()
|
||||
|
||||
# 根据加密方式为工程设置宏和输出路径
|
||||
function(set_encryption_definitions_and_output_path
|
||||
TARGET_NAME
|
||||
MODE)
|
||||
# ${TRIAL_YEAR} 在 cmakepresets.json内定义
|
||||
# ${PRODUCT} 在 cmakepresets.json内定义
|
||||
|
||||
# 下面处理加密
|
||||
if (MODE STREQUAL "TRIAL_YEAR") # TRIAL_YEAR 理论上不需要debug模式
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
BAL_REMOTE # TRIAL_YEAR加密默认BAL_REMOTE宏
|
||||
$<$<CONFIG:Release>:TRIAL_YEAR=${TRIAL_YEAR}> # ${TRIAL_YEAR} 在 cmakepresets.json内定义
|
||||
$<$<CONFIG:Debug>:WF2023>
|
||||
$<$<CONFIG:Release>:${PRODUCT}>
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
# 实际上,debug版本一直要带着加密,默认是BAL_REMOTE,但由于程序中检测加密锁是auto模式, REMOTE和LOCAL模式都可以通过验证
|
||||
$<$<CONFIG:Debug>:WF2023>
|
||||
$<$<CONFIG:Debug>:BAL_REMOTE>
|
||||
$<$<CONFIG:Release>:${PRODUCT}>
|
||||
$<$<CONFIG:Release>:${MODE}>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
||||
# 和上面的target_compile_definitions() debug 的情况一致使用 /WF2023/BAL_REMOTE 做为目录
|
||||
"${GLOBAL_BIN_DIR}/Debug-x64-${GENERATE_DIR_TAG}/WF2023/BAL_REMOTE")
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
||||
"${GLOBAL_BIN_DIR}/Release-x64-${GENERATE_DIR_TAG}/${PRODUCT}-${MODE}")
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG
|
||||
"${GLOBAL_LIB_DIR}/Debug-x64-${GENERATE_DIR_TAG}/WF2023-BAL_REMOTE"
|
||||
)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE
|
||||
"${GLOBAL_LIB_DIR}/Release-x64-${GENERATE_DIR_TAG}/${PRODUCT}-${MODE}"
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ThirdParty::BitAnswer)
|
||||
endfunction()
|
||||
|
||||
function(target_link_objectarx
|
||||
TARGET_NAME
|
||||
# 每个工程的dll标识宏都不一样,所以这里允许传入宏定义
|
||||
_EXTENSION
|
||||
)
|
||||
|
||||
if (ARGC LESS 2)
|
||||
message(FATAL_ERROR "target_link_objectarx() 函数至少需要两个参数: TARGET_NAME 和 _EXTENSION")
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ShsGlobalIncludes)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE "${DEP_INC_ROOT}")
|
||||
|
||||
# 1. 确定具体的 SDK 目录 (假设你的 SDK 按版本号平铺放置)
|
||||
simple_link_cad_sdk(${TARGET_NAME})
|
||||
#[[if (DEFINED CACHE{ZWCAD})
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ThirdParty::ZRX)
|
||||
else()
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ThirdParty::ARX)
|
||||
endif()]]
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE "rpcrt4.lib")
|
||||
|
||||
|
||||
# 4. 配置必须的宏定义和编译选项
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
CMAKE
|
||||
ARX=${SDK_VERSION}
|
||||
${_EXTENSION} # 指示这是一个 ARX 扩展
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# 定义函数:设置 Target 的输出名称和后缀
|
||||
function(target_set_name_and_suffix
|
||||
target_name
|
||||
new_name
|
||||
new_suffix)
|
||||
# 1. 检查目标是否存在,防止拼写错误导致静默失败
|
||||
if(NOT TARGET ${target_name})
|
||||
message(FATAL_ERROR "[ObjectARX-CMake] Target '${target_name}' 不存在!")
|
||||
endif()
|
||||
|
||||
# 2. 设置基础输出名称 (OUTPUT_NAME)
|
||||
# 无论是 exe, dll, arx 还是 lib,OUTPUT_NAME 都会统一修改主输出文件的 Base Name
|
||||
if(NOT "${new_name}" STREQUAL "")
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME "${new_name}")
|
||||
endif()
|
||||
|
||||
# 3. 设置后缀 (SUFFIX)
|
||||
if(NOT "${new_suffix}" STREQUAL "")
|
||||
# 获取 Target 的类型 (EXECUTABLE, SHARED_LIBRARY, MODULE_LIBRARY, STATIC_LIBRARY 等)
|
||||
get_target_property(target_type ${target_name} TYPE)
|
||||
|
||||
# 如果是 ".arx" 那么判断一下是不是中望版本,如果是则自动变成".zrx"
|
||||
if ("${new_suffix}" STREQUAL ".arx" AND IS_ZWCAD)
|
||||
set(new_suffix ".zrx")
|
||||
endif()
|
||||
|
||||
# 设置主输出文件的后缀
|
||||
set_target_properties(${target_name} PROPERTIES SUFFIX "${new_suffix}")
|
||||
|
||||
# 【核心细节】:针对动态库和导出符号的 EXE 进行导入库保护
|
||||
# 在 MSVC 中,构建 SHARED_LIBRARY (或开启 ENABLE_EXPORTS 的 EXE) 时,
|
||||
# 会同时生成 主文件(如 .arx) 和 导入库(如 .lib)。
|
||||
# 修改 SUFFIX 虽然主要作用于主文件,但为了防止某些 CMake 版本的意外行为或全局变量污染,
|
||||
# 显式将 IMPORT_SUFFIX 锁定为 ".lib" 是非常严谨的做法。
|
||||
if(target_type MATCHES "^(SHARED_LIBRARY|MODULE_LIBRARY|EXECUTABLE)$")
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
IMPORT_SUFFIX ".lib"
|
||||
IMPORT_PREFIX ""
|
||||
)
|
||||
endif()
|
||||
|
||||
# 注:如果是 STATIC_LIBRARY,CMake 原生就使用 SUFFIX 属性来控制后缀,
|
||||
# 传入 ".lib" 会完美适配,无需额外设置 IMPORT_SUFFIX。
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# 为工程的debug模式,设置分发路径,把生成物copy到相应的插件目录下面
|
||||
function(set_debug_post_build
|
||||
target_name # 工程名
|
||||
arx_name # 文件名
|
||||
ext # 后缀
|
||||
)
|
||||
set(CONFIG_JSON "sh_output_path.json")
|
||||
if (IS_ZWCAD)
|
||||
set(CONFIG_JSON "zw_output_path.json")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target_name}
|
||||
POST_BUILD
|
||||
# 核心:精准构造命令行参数
|
||||
COMMAND "$<$<CONFIG:Debug>:${CMAKE_SOURCE_DIR}/copyarx.exe>"
|
||||
"$<$<CONFIG:Debug>:CMAKE>"
|
||||
"$<$<CONFIG:Debug>:$<TARGET_FILE:${target_name}>>"
|
||||
"$<$<CONFIG:Debug>:${GENERATE_DIR_TAG}>"
|
||||
"$<$<CONFIG:Debug>:${CMAKE_SOURCE_DIR}/${CONFIG_JSON}>"
|
||||
COMMENT "正在调用 copyarx.exe 部署 ARX 模块..."
|
||||
VERBATIM
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(add_custom_module_2 dir_path target_name folder_path)
|
||||
# 1. 声明库
|
||||
add_subdirectory(${dir_path})
|
||||
|
||||
# 2. 设置 ARX 特有属性
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
FOLDER "${folder_path}" # 动态传入分组路径
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(add_custom_module dir_path folder_path)
|
||||
get_filename_component(target_name "${dir_path}" NAME)
|
||||
add_custom_module_2(${dir_path} ${target_name} ${folder_path})
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
# 声明最低版本 (与你的 CMakePresets.json 保持一致)
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
# CMP0091 策略最好放在最前面,确保全局生效
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
|
||||
# 强制指定 Windows SDK 版本为 Win11 SDK
|
||||
set(CMAKE_SYSTEM_VERSION "${WIN11_SDK}" CACHE STRING "Specify Windows SDK version" FORCE)
|
||||
|
||||
# 定义工程大本营
|
||||
project(CADProject VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
# 开启全局解决方案文件夹支持
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# 全局设定:强制所有配置使用 Release 版本的 CRT 运行库 (/MD)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
|
||||
|
||||
# 将我们自定义的 cmake 文件夹加入模块搜索路径
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(functions)
|
||||
|
||||
IsZWCAD(IS_ZWCAD)
|
||||
# 如果时中望,取出版本号的后两位,作为宏定义
|
||||
get_sdk_version(SDK_VERSION)
|
||||
|
||||
# ThirdPartyDeps里面使用了SDK_VERSION
|
||||
include(ThirdPartyDeps)
|
||||
|
||||
|
||||
# 对 CMake 生成的默认
|
||||
if(MSVC)
|
||||
# 剔除 所有工程内的 _DEBUG 宏, 判断是否是 debug/release 模式时,使用 NDEBUG 来判断
|
||||
string(REGEX REPLACE "[/-]D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
string(REGEX REPLACE "[/-]D_DEBUG" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
# 剔除 /RTC 相关的运行时检查参数 (如 /RTC1, /RTCs, /RTCu)
|
||||
# 这一步是消除 __MSVC_RUNTIME_CHECKS 宏的关键
|
||||
string(REGEX REPLACE "[/-]RTC[a-zA-Z0-9]+" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
string(REGEX REPLACE "[/-]RTC[a-zA-Z0-9]+" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
if (IS_ZWCAD)
|
||||
if (CAD_SDK_VERSION GREATER 2021)
|
||||
message(STATUS ">>> 检测到现代 ZRX SDK (${CAD_SDK_VERSION}),自动提权至 C++14 标准")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
else()
|
||||
if(CAD_SDK_VERSION GREATER 25)
|
||||
message(STATUS ">>> 检测到现代 ARX SDK (${CAD_SDK_VERSION}),自动提权至 C++20 标准")
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
elseif (CAD_SDK_VERSION GREATER_EQUAL 20)
|
||||
message(STATUS ">>> 检测到现代 ARX SDK (${CAD_SDK_VERSION}),自动提权至 C++14 标准")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
elseif (CAD_SDK_VERSION GREATER 19)
|
||||
message(STATUS ">>> 检测到现代 ARX SDK (${CAD_SDK_VERSION}),自动提权至 C++03 标准")
|
||||
set(CMAKE_CXX_STANDARD 03)
|
||||
else()
|
||||
message(STATUS ">>> 检测到传统 ARX SDK (${CAD_SDK_VERSION}),保持 C++98 标准")
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# 检查presets中是否定义了必要的变量
|
||||
# 把所有必须存在的变量名写成一个列表 (完美支持换行)
|
||||
set(REQUIRED_VARS
|
||||
CAD_SDK_ROOT
|
||||
DEP_LIB_ROOT
|
||||
DEP_INC_ROOT
|
||||
CAD_SDK_VERSION)
|
||||
|
||||
if (NOT IS_ZWCAD)
|
||||
list(APPEND REQUIRED_VARS CAD_SDK_SUBVERSION)
|
||||
endif()
|
||||
|
||||
# 2. 遍历这个列表进行检查
|
||||
foreach(VAR_NAME IN LISTS REQUIRED_VARS)
|
||||
# 注意这里使用了 ${VAR_NAME},它会展开成上面的字符串,如 "CAD_SDK_VERSION"
|
||||
if(NOT DEFINED ${VAR_NAME})
|
||||
message(FATAL_ERROR "【严重错误】缺少必要的配置变量: ${VAR_NAME}!请在 CMakePresets.json 中提供。")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# 以下为所有工程都加入相应的宏
|
||||
if(MSVC)
|
||||
# 🌟 开启 MSVC 多核并发编译!巨型工程提速的终极神器
|
||||
add_compile_options(/MP)
|
||||
|
||||
# 🌟 统一设置全局 Unicode 宏 (ARX 和 MFC 都强烈需要)
|
||||
add_compile_definitions(
|
||||
UNICODE
|
||||
_UNICODE
|
||||
# release 模式下,统一设置 NDEBUG 宏
|
||||
$<$<CONFIG:Release>:NDEBUG>
|
||||
# 关闭安全警告
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
|
||||
# 判断一下是不是中望cad
|
||||
if (IS_ZWCAD)
|
||||
message(STATUS ">>> 编译中望CAD版本")
|
||||
# 加入 ZWCAD 宏,为代码标记中望版本
|
||||
add_compile_definitions(ZWCAD)
|
||||
endif()
|
||||
|
||||
# 使用for 循环内声明的变量作用域
|
||||
add_compile_options(/Zc:forScope-)
|
||||
# 可选:关闭 MSVC 烦人的极度严格警告 (根据你的团队习惯开启/关闭)
|
||||
add_compile_options(/wd4819 /wd4996)
|
||||
endif()
|
||||
|
||||
# ==========================================
|
||||
# 第二部分:全局输出目录重定向 (精准路由)
|
||||
# ==========================================
|
||||
|
||||
# 用 CMake 内置命令把带 ../ 的路径“洗”成干净的绝对路径
|
||||
get_filename_component(GLOBAL_BIN_DIR "${GENERATE_BIN_DIR}" ABSOLUTE)
|
||||
get_filename_component(GLOBAL_LIB_DIR "${GENERATE_LIB_DIR}" ABSOLUTE)
|
||||
|
||||
# 生成形如 "R243", "R200" 的后缀,中望版本"Z2023","Z2024"
|
||||
|
||||
if (IS_ZWCAD)
|
||||
set(GENERATE_DIR_TAG "Z${CAD_SDK_VERSION}")
|
||||
else()
|
||||
set(GENERATE_DIR_TAG "R${CAD_SDK_VERSION}${CAD_SDK_SUBVERSION}")
|
||||
endif()
|
||||
message(STATUS ">>> 当前输出版本标签: ${GENERATE_DIR_TAG}")
|
||||
|
||||
# 配置输出目录
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${GLOBAL_BIN_DIR}/Debug-${GENERATE_DIR_TAG}")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${GLOBAL_BIN_DIR}/Release-${GENERATE_DIR_TAG}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${GLOBAL_LIB_DIR}/Debug-${GENERATE_DIR_TAG}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${GLOBAL_LIB_DIR}/Release-${GENERATE_DIR_TAG}")
|
||||
|
||||
message(STATUS ">>> 正在构建业务树...")
|
||||
|
||||
add_subdirectory(./src/AutoAgent)
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"version": 10,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 21,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "base",
|
||||
"hidden": true,
|
||||
"$comment": " 各个子preset统一使用 vs2026,本地vs2026 已经安装好了需要使用的 Toolset",
|
||||
"generator": "Visual Studio 18 2026",
|
||||
"architecture": "x64",
|
||||
"binaryDir": "${sourceDir}/out/${presetName}",
|
||||
"cacheVariables": {
|
||||
"VCPKG_INSTALLED_DIR": "${sourceDir}/out/vcpkg_shared_installed",
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md",
|
||||
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake",
|
||||
"WIN11_SDK": "10.0.22621.0",
|
||||
"DEP_LIB_ROOT": "${sourceDir}/dep_lib",
|
||||
"DEP_INC_ROOT": "${sourceDir}/dep_inc",
|
||||
"GENERATE_BIN_DIR": "${sourceDir}/bin",
|
||||
"GENERATE_LIB_DIR": "${sourceDir}/lib"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "acad_base",
|
||||
"hidden": true,
|
||||
"inherits": "base",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_ROOT": "${sourceDir}/../new-start/envi-code/Arx"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "zwcad_base",
|
||||
"hidden": true,
|
||||
"inherits": "base",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_ROOT": "${sourceDir}/../new-start/envi-code/Zrx"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R260",
|
||||
"$comment": "ARX 26.0 vs2022 v143 CAD(2027)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v143",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "26",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R250",
|
||||
"$comment": "ARX 25.0 vs2022 v143 CAD(2025-2026)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v143",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "25",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R243",
|
||||
"$comment": "ARX 24.3 vs2022 v143 CAD(2024)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v143",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "24",
|
||||
"CAD_SDK_SUBVERSION": "3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R240",
|
||||
"$comment": "ARX 24.0 vs2019 v142 CAD(2021-2023)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v142",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "24",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R230",
|
||||
"$comment": "ARX 23.0 vs2017 v141 CAD(2019-2020)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v141",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "23",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R220",
|
||||
"$comment": "ARX 22.0 vs2015 v140 CAD(2018)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v140",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "22",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R210",
|
||||
"$comment": "ARX 21.0 vs2015 v140 CAD(2017)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v140",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "21",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R200",
|
||||
"$comment": "ARX 20.0 vs2012 v110 CAD(2015-2016)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v110",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "20",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R190",
|
||||
"$comment": "ARX 19.0 vs2010 v100 CAD(2013-2014)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v100",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "19",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "R180",
|
||||
"$comment": "ARX 18.0 vs2008 v90 CAD(2010-2012)",
|
||||
"inherits": "acad_base",
|
||||
"toolset": "v90",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "18",
|
||||
"CAD_SDK_SUBVERSION": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Z2026",
|
||||
"$comment": "ZRX 2026 vs2017 v141 ZWCAD(2026)",
|
||||
"inherits": "zwcad_base",
|
||||
"toolset": "v141",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "2026",
|
||||
"ZWCAD": "ZWCAD"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Z2025",
|
||||
"$comment": "ZRX 2025 vs2017 v141 ZWCAD(2025)",
|
||||
"inherits": "zwcad_base",
|
||||
"toolset": "v141",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "2025",
|
||||
"ZWCAD": "ZWCAD"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Z2024",
|
||||
"$comment": "ZRX 2024 vs2017 v141 ZWCAD(2024)",
|
||||
"inherits": "zwcad_base",
|
||||
"toolset": "v141",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "2024",
|
||||
"ZWCAD": "ZWCAD"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Z2023",
|
||||
"$comment": "ZRX 2023 vs2017 v141 ZWCAD(2023)",
|
||||
"inherits": "zwcad_base",
|
||||
"toolset": "v141",
|
||||
"cacheVariables": {
|
||||
"CAD_SDK_VERSION": "2023",
|
||||
"ZWCAD": "ZWCAD"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "R260",
|
||||
"configurePreset": "R260"
|
||||
},
|
||||
{
|
||||
"name": "R250",
|
||||
"configurePreset": "R250"
|
||||
},
|
||||
{
|
||||
"name": "R243",
|
||||
"configurePreset": "R243"
|
||||
},
|
||||
{
|
||||
"name": "R240",
|
||||
"configurePreset": "R240"
|
||||
},
|
||||
{
|
||||
"name": "R230",
|
||||
"configurePreset": "R230"
|
||||
},
|
||||
{
|
||||
"name": "R220",
|
||||
"configurePreset": "R220"
|
||||
},
|
||||
{
|
||||
"name": "R210",
|
||||
"configurePreset": "R210"
|
||||
},
|
||||
{
|
||||
"name": "R200",
|
||||
"configurePreset": "R200"
|
||||
},
|
||||
{
|
||||
"name": "R190",
|
||||
"configurePreset": "R190"
|
||||
},
|
||||
{
|
||||
"name": "R180",
|
||||
"configurePreset": "R180"
|
||||
},
|
||||
{
|
||||
"name": "Z2026",
|
||||
"configurePreset": "Z2026"
|
||||
},
|
||||
{
|
||||
"name": "Z2025",
|
||||
"configurePreset": "Z2025"
|
||||
},
|
||||
{
|
||||
"name": "Z2024",
|
||||
"configurePreset": "Z2024"
|
||||
},
|
||||
{
|
||||
"name": "Z2023",
|
||||
"configurePreset": "Z2023"
|
||||
}
|
||||
]
|
||||
}
|
||||
+566
@@ -0,0 +1,566 @@
|
||||
#pragma once
|
||||
|
||||
// Description:
|
||||
// AutoCAD ObjectARX开发包KTCadKernel,提供对ObjectARX的二次封装,
|
||||
// 使的开发更加方便,使用时只要将本文件#include进stdafx.h文件中即可,
|
||||
// 并且大部分的arx的头文件都不需要在别处包含了
|
||||
// Company: Kingtouch Software Corporation. Copyright 2002-2005
|
||||
// Author: WangYongguang
|
||||
// Date: 2002.05.01
|
||||
|
||||
// 根据ObjectARX版本不同链接不同库文件
|
||||
|
||||
/* 郭建明 于 2017/04/09 修改
|
||||
|
||||
从2010开始,vc++ 可以用切换 PlatformToolset 的方式编译低版本的二进制代码。
|
||||
所以,不再需要在工程中自己为ADS宏定义版本(例如: ADS=19),
|
||||
只需要 ADS=$(PlatformToolsetVersion) 即可自动赋值。
|
||||
故 ADS 由以前的 ObjectARX 版本号,改为 VC++ PlatformToolset 号。
|
||||
这样一来,只需要切换相应的 PlatformToolset 就可以编译各个CAD平台所使用的二进制文件。
|
||||
|
||||
PS:
|
||||
ADS 宏 改为在 earthworm.props 文件内定义。
|
||||
|
||||
|
||||
版本映射:
|
||||
| vc platformtoolset | arx | vc平台 | cad |
|
||||
| 80 | 17 | vc2005 | 2007-2009 |
|
||||
| 90 | 18 | vc2008 | 2010-2012 |
|
||||
| 100 | 19 | vc2010 | 2013-2014 |
|
||||
| 110 | 20 | vc2012 | 2015-2016 |
|
||||
| 140 | 21 | vc2015 | 2017 | R21 使用vc2015编译
|
||||
| 140 | 22 | vc2015 | 2018 | R22 使用vc2015编译
|
||||
| 141 | 23 | vc2017 | 2019-2020 |
|
||||
| 142 | 24 | vc2019 | 2021-2023 | R24.0-R24.2 使用vc2019编译
|
||||
| 143 | 24.3| vc2022 | 2024 | R24.3使用vc2022编译
|
||||
| 143 | 25 | vc2022 | 2025-2026 |
|
||||
| 143 | 26 | vc2022 | 2027- |
|
||||
*/
|
||||
|
||||
#ifndef ZWCAD
|
||||
|
||||
// 以前通过 toolset 来倒推 ARX,现在已经不行了. R24.3,R25,R26都使用 v143 编译
|
||||
// 所以,现在打包是使用 cmake 工具, ARX 直接从外部传入
|
||||
#ifdef CMAKE
|
||||
// ARX 从 cmake传入,不再使用toolset倒推
|
||||
// 对 objectarx库文件的依赖再cmake中定义
|
||||
#else
|
||||
#if ADS == 80 // VC++2005
|
||||
#define ARX 17
|
||||
#elif ADS == 90 // VC++2008
|
||||
#define ARX 18
|
||||
#elif ADS == 100 // VC++2010
|
||||
#define ARX 19
|
||||
#elif ADS == 110 // VC++2012
|
||||
#define ARX 20
|
||||
#elif ADS == 140 && !defined(R22) // VC++2015
|
||||
#define ARX 21
|
||||
#elif ADS == 140 && defined(R22) // VC++2015
|
||||
#define ARX 22
|
||||
#elif ADS == 141 // VC++2017
|
||||
#define ARX 23
|
||||
#elif ADS == 142 // VC++2019
|
||||
#define ARX 24
|
||||
#elif ADS == 143 // VC++2022
|
||||
#define ARX 25
|
||||
|
||||
// 注意,以下ARX不要再用此方式编译调试了,toolset已经不能倒推ARX了,所以,如果要编译R26,请使用 cmake,
|
||||
// #elif ADS == 143 // VC++2022
|
||||
// #define ARX 26
|
||||
// #elif ADS == 143 // VC++2022
|
||||
// #define ARX 27
|
||||
#endif
|
||||
|
||||
// 下面定义去要依赖的objectarx的库
|
||||
#if ARX == 17
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acedapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb17.lib")
|
||||
#pragma comment(lib, "acge17.lib")
|
||||
#pragma comment(lib, "acISMobj17.lib")
|
||||
#pragma comment(lib, "aecmodeler50.lib")
|
||||
#pragma comment(lib, "adui17.lib")
|
||||
#pragma comment(lib, "acui17.lib")
|
||||
#pragma comment(lib, "acgex17.lib")
|
||||
#pragma comment(lib, "acbr17.lib")
|
||||
#endif // arx 17
|
||||
#if ARX == 18
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acedapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb18.lib")
|
||||
#pragma comment(lib, "acge18.lib")
|
||||
#pragma comment(lib, "acISMobj18.lib")
|
||||
#pragma comment(lib, "aecmodeler60.lib")
|
||||
#pragma comment(lib, "adui18.lib")
|
||||
#pragma comment(lib, "acui18.lib")
|
||||
#pragma comment(lib, "acgex18.lib")
|
||||
#pragma comment(lib, "acbr18.lib")
|
||||
#endif // arx 18
|
||||
|
||||
#if ARX == 19
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb19.lib")
|
||||
#pragma comment(lib, "acge19.lib")
|
||||
#pragma comment(lib, "acISMobj19.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "adui19.lib")
|
||||
#pragma comment(lib, "acui19.lib")
|
||||
#pragma comment(lib, "ac1st19.lib")
|
||||
#pragma comment(lib, "acgex19.lib")
|
||||
#pragma comment(lib, "acbr19.lib")
|
||||
#endif // arx 19
|
||||
|
||||
#if ARX == 20
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb20.lib")
|
||||
#pragma comment(lib, "acge20.lib")
|
||||
#pragma comment(lib, "acISMobj20.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "adui20.lib")
|
||||
#pragma comment(lib, "acui20.lib")
|
||||
#pragma comment(lib, "ac1st20.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex20.lib")
|
||||
#pragma comment(lib, "acbr20.lib")
|
||||
#endif // arx 20
|
||||
|
||||
#if ARX == 21
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb21.lib")
|
||||
#pragma comment(lib, "acge21.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "acISMobj21.lib")
|
||||
#pragma comment(lib, "adui21.lib")
|
||||
#pragma comment(lib, "acui21.lib")
|
||||
#pragma comment(lib, "ac1st21.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex21.lib")
|
||||
#pragma comment(lib, "acbr21.lib")
|
||||
#endif // arx 21
|
||||
|
||||
#if ARX == 22
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb22.lib")
|
||||
#pragma comment(lib, "acge22.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "acISMobj22.lib")
|
||||
#pragma comment(lib, "adui22.lib")
|
||||
#pragma comment(lib, "acui22.lib")
|
||||
#pragma comment(lib, "ac1st22.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex22.lib")
|
||||
#pragma comment(lib, "acbr22.lib")
|
||||
#endif // arx 22
|
||||
|
||||
#if ARX == 23
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "acdb23.lib")
|
||||
#pragma comment(lib, "acge23.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "acISMobj23.lib")
|
||||
#pragma comment(lib, "adui23.lib")
|
||||
#pragma comment(lib, "acui23.lib")
|
||||
#pragma comment(lib, "ac1st23.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex23.lib")
|
||||
#pragma comment(lib, "acbr23.lib")
|
||||
#endif // arx 23
|
||||
|
||||
#if ARX == 24
|
||||
#pragma comment(lib, "acpal.lib")
|
||||
#pragma comment(lib, "ac1st24.lib")
|
||||
#pragma comment(lib, "acdb24.lib")
|
||||
#pragma comment(lib, "acge24.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "acISMobj24.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "adui24.lib")
|
||||
#pragma comment(lib, "acui24.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex24.lib")
|
||||
#pragma comment(lib, "acbr24.lib")
|
||||
#pragma comment(lib, "acgeoment.lib")
|
||||
#endif // arx 24
|
||||
|
||||
#if ARX == 25
|
||||
#pragma comment(lib, "acpal.lib")
|
||||
#pragma comment(lib, "ac1st25.lib")
|
||||
#pragma comment(lib, "acdb25.lib")
|
||||
#pragma comment(lib, "acge25.lib")
|
||||
#pragma comment(lib, "acgiapi.lib")
|
||||
#pragma comment(lib, "acISMobj25.lib")
|
||||
#pragma comment(lib, "rxapi.lib")
|
||||
#pragma comment(lib, "acad.lib")
|
||||
#pragma comment(lib, "accore.lib")
|
||||
#pragma comment(lib, "axdb.lib")
|
||||
#pragma comment(lib, "aecmodeler.lib")
|
||||
#pragma comment(lib, "adui25.lib")
|
||||
#pragma comment(lib, "acui25.lib")
|
||||
#pragma comment(lib, "acdrawbridge.lib")
|
||||
#pragma comment(lib, "acgex25.lib")
|
||||
#pragma comment(lib, "acbr25.lib")
|
||||
#pragma comment(lib, "acgeoment.lib")
|
||||
#endif // arx 25
|
||||
|
||||
#endif // !CMAKE
|
||||
|
||||
#else // ZWCAD
|
||||
#if ADS == 141 // VC++2017
|
||||
#if defined(R24)
|
||||
#define ARX 24
|
||||
#pragma message("Automatically linking with ZRX 2024.")
|
||||
#elif defined(R25)
|
||||
#define ARX 25
|
||||
#pragma message("Automatically linking with ZRX 2025.")
|
||||
#elif defined(R26)
|
||||
#define ARX 26
|
||||
#pragma message("Automatically linking with ZRX 2026.")
|
||||
#endif
|
||||
#pragma comment(lib, "ZwBase.lib")
|
||||
#pragma comment(lib, "ZWCAD.lib")
|
||||
#pragma comment(lib, "ZwAuto.lib")
|
||||
#pragma comment(lib, "ZwRx.lib")
|
||||
#pragma comment(lib, "ZwZrx.lib")
|
||||
#pragma comment(lib, "ZwGeometry.lib")
|
||||
#pragma comment(lib, "ZwDatabase.lib")
|
||||
#pragma comment(lib, "ZwDatabaseMgd.lib")
|
||||
#pragma comment(lib, "ZwdUI.lib")
|
||||
#pragma comment(lib, "ZwGs.lib")
|
||||
#pragma comment(lib, "ZwTc.lib")
|
||||
#pragma comment(lib, "ZwUI.lib")
|
||||
#pragma comment(lib, "ZwBrep.lib")
|
||||
#pragma comment(lib, "ZwAECModeler.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ARX > 18
|
||||
#include "acedads.h"
|
||||
#include "adsmigr.h"
|
||||
#endif
|
||||
|
||||
#ifndef ZWCAD
|
||||
#if ARX > 19
|
||||
#if defined(acedCommand)
|
||||
#undef acedCommand
|
||||
#endif
|
||||
#define acedCommand Old_Function_Must_Switch_To_SHacedCommand
|
||||
|
||||
#if defined(ads_command)
|
||||
#undef ads_command
|
||||
#endif
|
||||
#define ads_command Old_Function_Must_Switch_To_SHads_command
|
||||
|
||||
#if defined(acedCmd)
|
||||
#undef acedCmd
|
||||
#endif
|
||||
#define acedCmd Old_Function_Must_Switch_To_SHacedCmd
|
||||
|
||||
#define SHacedCommand(rtype, ...) acedCommandS((rtype), __VA_ARGS__)
|
||||
#define SHacedCmd(rb) acedCmdS((rb))
|
||||
#define SHads_command SHacedCommand
|
||||
#else
|
||||
#define SHacedCommand(rtype, ...) acedCommand((rtype), __VA_ARGS__)
|
||||
#define SHacedCmd(rb) acedCmd((rb))
|
||||
#define SHads_command SHacedCommand
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if ARX > 19
|
||||
#define SHacedCommand(rtype, ...) acedCommand((rtype), __VA_ARGS__)
|
||||
#define SHacedCmd(rb) acedCmdS((rb))
|
||||
#define SHads_command SHacedCommand
|
||||
#else
|
||||
#define SHacedCommand(rtype, ...) acedCommand((rtype), __VA_ARGS__)
|
||||
#define SHacedCmd(rb) acedCmd((rb))
|
||||
#define SHads_command SHacedCommand
|
||||
#endif
|
||||
|
||||
extern void zrxPostCommand(wchar_t const *);
|
||||
|
||||
#ifndef acrxEntryPoint
|
||||
#define acrxEntryPoint zcrxEntryPoint
|
||||
#endif
|
||||
|
||||
#ifndef acedPostCommand
|
||||
#define acedPostCommand zrxPostCommand
|
||||
#endif
|
||||
|
||||
#ifndef fromAcDbTextStyle
|
||||
#define fromAcDbTextStyle fromZcDbTextStyle
|
||||
#endif
|
||||
|
||||
#ifndef ASMBodyCopy
|
||||
#define ASMBodyCopy ZSMBodyCopy
|
||||
#endif
|
||||
|
||||
#ifndef getLockedASMBody
|
||||
#define getLockedASMBody getLockedZSMBody
|
||||
#endif
|
||||
|
||||
#ifndef unlockASMBody
|
||||
#define unlockASMBody unlockZSMBody
|
||||
#endif
|
||||
|
||||
#ifndef getLockedWritableASMBody
|
||||
#define getLockedWritableASMBody getLockedWritableZSMBody
|
||||
#endif
|
||||
|
||||
#ifndef commitWritableASMBody
|
||||
#define commitWritableASMBody commitWritableZSMBody
|
||||
#endif
|
||||
|
||||
#ifndef setASMBody
|
||||
#define setASMBody setZSMBody
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (ARX > 19)
|
||||
#include "acedCmdNF.h"
|
||||
#endif
|
||||
|
||||
#pragma region INCLUDE
|
||||
#include "accmd.h"
|
||||
#include "acdb.h"
|
||||
#include "acdbabb.h"
|
||||
#include "aced.h"
|
||||
#include "acedinpt.h"
|
||||
#include "acestext.h"
|
||||
#include "acgi.h"
|
||||
#include "acgiutil.h"
|
||||
#include "AcGsManager.h"
|
||||
#include "acgs.h"
|
||||
#include "gs.h"
|
||||
#include "AcDbLMgr.h"
|
||||
#include "actrans.h"
|
||||
#include "adesk.h"
|
||||
#include "adeskabb.h"
|
||||
#include "ads.h"
|
||||
#include "adscodes.h"
|
||||
#include "adsdef.h"
|
||||
#include "adsdlg.h"
|
||||
#include "adslib.h"
|
||||
#include "adsrxdef.h"
|
||||
#include "appinfo.h"
|
||||
#include "dbacis.h"
|
||||
#include "dbapserv.h"
|
||||
#include "dbaudita.h"
|
||||
#include "dbbody.h"
|
||||
#include "dbboiler.h"
|
||||
#include "dbcfilrs.h"
|
||||
#include "dbcurve.h"
|
||||
#include "dbdate.h"
|
||||
#include "dbdict.h"
|
||||
#include "dbdictdflt.h"
|
||||
#include "dbelipse.h"
|
||||
#include "dbents.h"
|
||||
#include "dbfcf.h"
|
||||
#include "dbfiler.h"
|
||||
#include "dbfilter.h"
|
||||
#include "dbframe.h"
|
||||
#include "dbgroup.h"
|
||||
#include "dbhandle.h"
|
||||
#include "dbhatch.h"
|
||||
#include "dbid.h"
|
||||
#include "dbidar.h"
|
||||
#include "dbidmap.h"
|
||||
#if ARX < 23
|
||||
#include "dbid_ops.h"
|
||||
#endif
|
||||
#include "dbimage.h"
|
||||
#include "dbindex.h"
|
||||
#include "dbintar.h"
|
||||
#include "dbjig.h"
|
||||
#include "dblayout.h"
|
||||
#include "dblead.h"
|
||||
#include "dbltrans.h"
|
||||
#include "dblyfilt.h"
|
||||
#include "dblyindx.h"
|
||||
#include "dbmain.h"
|
||||
#include "dbmline.h"
|
||||
#include "dbmstyle.h"
|
||||
#include "dbmtext.h"
|
||||
#include "dbole.h"
|
||||
#include "dbpl.h"
|
||||
#include "dbplhldr.h"
|
||||
#include "dbplotsettings.h"
|
||||
#include "dbproxy.h"
|
||||
#include "dbptrar.h"
|
||||
#include "dbray.h"
|
||||
#include "dbregion.h"
|
||||
#include "dbsol3d.h"
|
||||
#include "dbspline.h"
|
||||
#include "dbspfilt.h"
|
||||
#include "dbspindx.h"
|
||||
#include "dbsubeid.h"
|
||||
#include "dbsymtb.h"
|
||||
#include "dbxline.h"
|
||||
#include "dbxrecrd.h"
|
||||
#include "dbxutil.h"
|
||||
#include "summinfo.h"
|
||||
#include "geapln3d.h"
|
||||
#include "gearc2d.h"
|
||||
#include "gearc3d.h"
|
||||
#include "geassign.h"
|
||||
#include "geblok2d.h"
|
||||
#include "geblok3d.h"
|
||||
#include "gebndpln.h"
|
||||
#include "gecbndry.h"
|
||||
#include "gecint2d.h"
|
||||
#include "gecint3d.h"
|
||||
#include "gecomp2d.h"
|
||||
#include "gecomp3d.h"
|
||||
#include "gecone.h"
|
||||
#include "gecspl2d.h"
|
||||
#include "gecspl3d.h"
|
||||
#include "gecurv2d.h"
|
||||
#include "gecurv3d.h"
|
||||
#include "gecylndr.h"
|
||||
#include "gedblar.h"
|
||||
#include "gedll.h"
|
||||
#include "gedwgio.h"
|
||||
#include "gedxfio.h"
|
||||
#include "geell2d.h"
|
||||
#include "geell3d.h"
|
||||
#include "geent2d.h"
|
||||
#include "geent3d.h"
|
||||
#include "geextc2d.h"
|
||||
#include "geextc3d.h"
|
||||
#include "geextsf.h"
|
||||
#include "gefileio.h"
|
||||
#include "gefiler.h"
|
||||
#include "gegbl.h"
|
||||
#include "gegblabb.h"
|
||||
#include "geintarr.h"
|
||||
#include "geintrvl.h"
|
||||
#include "gekvec.h"
|
||||
#include "gelent2d.h"
|
||||
#include "gelent3d.h"
|
||||
#include "gelibver.h"
|
||||
#include "geline2d.h"
|
||||
#include "geline3d.h"
|
||||
#include "gelnsg2d.h"
|
||||
#include "gelnsg3d.h"
|
||||
#include "gemat2d.h"
|
||||
#include "gemat3d.h"
|
||||
#include "genurb2d.h"
|
||||
#include "genurb3d.h"
|
||||
#include "genurbsf.h"
|
||||
#include "geoffc2d.h"
|
||||
#include "geoffc3d.h"
|
||||
#include "geoffsf.h"
|
||||
#include "gepent2d.h"
|
||||
#include "gepent3d.h"
|
||||
#include "geplanar.h"
|
||||
#include "geplane.h"
|
||||
#include "geplin2d.h"
|
||||
#include "geplin3d.h"
|
||||
#include "gepnt2d.h"
|
||||
#include "gepnt3d.h"
|
||||
#include "geponc2d.h"
|
||||
#include "geponc3d.h"
|
||||
#include "geponsrf.h"
|
||||
#include "gepos2d.h"
|
||||
#include "gepos3d.h"
|
||||
#include "gept2dar.h"
|
||||
#include "gept3dar.h"
|
||||
#include "geray2d.h"
|
||||
#include "geray3d.h"
|
||||
#include "gescl2d.h"
|
||||
#include "gescl3d.h"
|
||||
#include "gesent2d.h"
|
||||
#include "gesent3d.h"
|
||||
#include "gesphere.h"
|
||||
#include "gesurf.h"
|
||||
#include "getol.h"
|
||||
#include "getorus.h"
|
||||
#include "gevc2dar.h"
|
||||
#include "gevc3dar.h"
|
||||
#include "gevec2d.h"
|
||||
#include "gevec3d.h"
|
||||
#include "gevptar.h"
|
||||
#include "gexbndsf.h"
|
||||
#include "graph.h"
|
||||
#include "imgdef.h"
|
||||
#include "imgent.h"
|
||||
#include "imgvars.h"
|
||||
#include "lngtrans.h"
|
||||
#include "migrtion.h"
|
||||
#include "oleaprot.h"
|
||||
#include "ol_errno.h"
|
||||
#include "rxboiler.h"
|
||||
#include "rxclass.h"
|
||||
#include "rxdefs.h"
|
||||
#include "rxdict.h"
|
||||
#include "rxditer.h"
|
||||
#include "rxdlinkr.h"
|
||||
#include "rxiter.h"
|
||||
#include "rxkernel.h"
|
||||
#include "rxmfcapi.h"
|
||||
#include "rxnames.h"
|
||||
#include "rxobject.h"
|
||||
#include "rxregsvc.h"
|
||||
#include "rxsrvice.h"
|
||||
#include "xgraph.h"
|
||||
#include "adui.h"
|
||||
#include "acui.h"
|
||||
#include "acuiDialog.h"
|
||||
#include <AcExtensionModule.h>
|
||||
#include "amodeler.h"
|
||||
#include "Point3d.h"
|
||||
#include "axlock.h"
|
||||
#include "dbsubd.h"
|
||||
#include "dbobjptr.h"
|
||||
#pragma endregion
|
||||
|
||||
#ifndef ZWCAD
|
||||
extern Adesk::Boolean acedPostCommand(const TCHAR *pszCmd);
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
// 为 vc2008 的 std::tr1::shared_ptr 注入std空间
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1500) // VC2008 及更早版本
|
||||
namespace std
|
||||
{
|
||||
using tr1::shared_ptr;
|
||||
using tr1::weak_ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
cmake --preset R190
|
||||
cmake --preset R230
|
||||
cmake --preset R220
|
||||
pause
|
||||
@@ -0,0 +1,87 @@
|
||||
# ===== Visual Studio / MSVC =====
|
||||
# 生成目录
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
x86/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
build/
|
||||
out/
|
||||
[Bb]uild/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 用户设置
|
||||
.vs/
|
||||
*.user
|
||||
*.suo
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
*.opendb
|
||||
*.dbmdl
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.cachefile
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.log
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/
|
||||
|
||||
# ===== 编译产物 =====
|
||||
*.obj
|
||||
*.o
|
||||
*.lo
|
||||
*.slo
|
||||
*.pch
|
||||
*.pdb
|
||||
*.idb
|
||||
*.ilk
|
||||
*.exp
|
||||
*.out
|
||||
*.app
|
||||
*.res
|
||||
*.gch
|
||||
*.ipch
|
||||
|
||||
# 中间文件
|
||||
*.i
|
||||
*.ii
|
||||
*.s
|
||||
*.asm
|
||||
*.cod
|
||||
|
||||
# ===== CMake =====
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
CMakeUserPresets.json
|
||||
install_manifest.txt
|
||||
|
||||
# ===== 依赖 / 包管理 =====
|
||||
vcpkg_installed/
|
||||
packages/
|
||||
*.nupkg
|
||||
*.snupkg
|
||||
.nuget/
|
||||
|
||||
# ===== 其他 =====
|
||||
*.tmp
|
||||
*.temp
|
||||
*.bak
|
||||
*.swp
|
||||
*~
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
desktop.ini
|
||||
|
||||
# 日志
|
||||
*.log
|
||||
*.trace
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "StdAfx.h"
|
||||
#include "resource.h"
|
||||
#include "cadsdk.h"
|
||||
|
||||
HINSTANCE _hdllInstance = NULL ;
|
||||
|
||||
#ifndef _ttof
|
||||
#define _ttof(pszVal) _tcstod((pszVal), NULL)
|
||||
#endif
|
||||
|
||||
void AddCommand(const TCHAR* cmdGroup, const TCHAR* cmdInt, const TCHAR* cmdLoc,
|
||||
const int cmdFlags, const AcRxFunctionPtr cmdProc, const int idLocal = -1);
|
||||
|
||||
void InitApplication();
|
||||
void UnloadApplication();
|
||||
|
||||
AC_IMPLEMENT_EXTENSION_MODULE(EarthWormDLL);
|
||||
|
||||
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
_hdllInstance = hInstance;
|
||||
EarthWormDLL.AttachInstance(hInstance);
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
EarthWormDLL.DetachInstance();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case AcRx::kInitAppMsg:
|
||||
acrxDynamicLinker->unlockApplication(pkt);
|
||||
acrxDynamicLinker->registerAppMDIAware(pkt);
|
||||
InitApplication();
|
||||
break;
|
||||
case AcRx::kUnloadAppMsg:
|
||||
UnloadApplication();
|
||||
break;
|
||||
}
|
||||
return AcRx::kRetOK;
|
||||
}
|
||||
|
||||
void CR_SCGXCmdFnc();
|
||||
void InitApplication()
|
||||
{
|
||||
acrxBuildClassHierarchy();
|
||||
|
||||
AddCommand(_T("SHCRACKTOOLS"), _T("CR_SCGX"), _T("CR_SCGX"), ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, CR_SCGXCmdFnc);
|
||||
|
||||
}
|
||||
|
||||
void UnloadApplication()
|
||||
{
|
||||
acedRegCmds->removeGroup(_T("SHCRACKTOOLS"));
|
||||
}
|
||||
|
||||
void AddCommand(const TCHAR* cmdGroup, const TCHAR* cmdInt, const TCHAR* cmdLoc,
|
||||
const int cmdFlags, const AcRxFunctionPtr cmdProc, const int idLocal)
|
||||
{
|
||||
TCHAR cmdLocRes[65];
|
||||
|
||||
if (idLocal != -1)
|
||||
{
|
||||
::LoadString(_hdllInstance, idLocal, cmdLocRes, 64);
|
||||
acedRegCmds->addCommand(cmdGroup, cmdInt, cmdLocRes, cmdFlags, cmdProc);
|
||||
}
|
||||
else
|
||||
{
|
||||
acedRegCmds->addCommand(cmdGroup, cmdInt, cmdLoc, cmdFlags, cmdProc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
LIBRARY "AutoAgent.arx"
|
||||
|
||||
EXPORTS
|
||||
acrxEntryPoint PRIVATE
|
||||
acrxGetApiVersion PRIVATE
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Chinese (Simplified, PRC) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
|
||||
#pragma code_page(936)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""res\\AutoAgent.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "AutoAgent ObjectARX application"
|
||||
VALUE "FileVersion", "1, 0, 0, 1"
|
||||
VALUE "InternalName", "AutoAgent"
|
||||
VALUE "LegalCopyright", "Copyright 2014"
|
||||
VALUE "OriginalFilename", "AutoAgent.arx"
|
||||
VALUE "ProductName", "AutoAgent Application"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "AutoAgent"
|
||||
END
|
||||
|
||||
#endif // Chinese (Simplified, PRC) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#include "res\AutoAgent.rc2" // non-Microsoft Visual C++ edited resources
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// StdAfx.cpp : source file that includes just the standard includes
|
||||
// StdAfx.pch will be the pre-compiled header
|
||||
// StdAfx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define WINVER 0x0600
|
||||
|
||||
#pragma warning(disable: 4786)
|
||||
|
||||
//- 'DEBUG workaround' below prevents the MFC or ATL #include-s from pulling
|
||||
//- in "Afx.h" that would force the debug CRT through #pragma-s.
|
||||
#if defined(_DEBUG) && !defined(AC_FULL_DEBUG)
|
||||
#define _DEBUG_WAS_DEFINED
|
||||
#undef _DEBUG
|
||||
#pragma message ("Compiling MFC / STL / ATL header files in release mode.")
|
||||
#endif
|
||||
|
||||
#pragma pack (push, 8)
|
||||
#pragma warning(disable: 4786 4996)
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxole.h> // MFC OLE classes
|
||||
#include <afxodlgs.h> // MFC OLE dialog classes
|
||||
#include <afxdisp.h> // MFC Automation classes
|
||||
#endif
|
||||
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <afxdhtml.h>
|
||||
#include <afxwin.h>
|
||||
|
||||
extern HINSTANCE _hdllInstance;
|
||||
|
||||
#ifdef _DEBUG_WAS_DEFINED
|
||||
#define _DEBUG
|
||||
#undef _DEBUG_WAS_DEFINED
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(AutoAgent)
|
||||
|
||||
find_package(nlohmann_json CONFIG REQUIRED)
|
||||
find_package(CURL CONFIG REQUIRED)
|
||||
|
||||
set(SOURCES
|
||||
"AutoAgent.cpp"
|
||||
"command.cpp"
|
||||
"stdafx.cpp"
|
||||
"AutoAgent.rc"
|
||||
)
|
||||
add_def_file_name(SOURCES "${PROJECT_NAME}")
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
||||
|
||||
target_precompile_headers(${PROJECT_NAME} PRIVATE StdAfx.h)
|
||||
|
||||
target_link_objectarx(${PROJECT_NAME} AECRXBASE_EXPORT)
|
||||
|
||||
target_set_name_and_suffix(${PROJECT_NAME} "${PROJECT_NAME}" ".arx")
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:forScope)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
nlohmann_json::nlohmann_json
|
||||
CURL::libcurl
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
void CR_SCGXCmdFnc()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// AutoAgent.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,16 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by newProject.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 426
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 438
|
||||
#define _APS_NEXT_SYMED_VALUE 122
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "cad-ocr",
|
||||
"version": "1.0.0",
|
||||
"dependencies": [
|
||||
"nlohmann-json",
|
||||
"curl"
|
||||
],
|
||||
"builtin-baseline": "127402f1c75bb3d5ff6bce04b285faa4930a5aca"
|
||||
}
|
||||
Reference in new issue
Block a user