## 项目结构 ``` . │ CMakeLists.txt \\CMake构建配置文件 │ config.h.in │ readme.md ├─data │ ├─demo │ │ └─ ... │ └─Tinyroute_test │ │ connector.csv \\连接器数据 │ │ result_ALL.txt \\当前数据与参数下应运行出的结果数据 │ ├─clip2 │ │ clips_with_dir.xml \\空间中卡箍点集数据 │ ├─OBJ │ │ cangti_correct.obj \\输入模型 │ └─wirexml \\ 连接器间连接关系 │ 1START_END.xml │ 2NEAR_END.xml │ 3NEAR_START.xml ├─include │ read_xml.h │ ├─lib \\所用运行库 │ │ tinyxml.lib │ │ WireRouting_DLL.dll │ │ WireRouting_DLL.lib │ │ │ └─include \\库相关头文件 │ Astar.h │ BasicChannel.h │ BasicEdge.h | ... │ ├─pre_build \\预编译可执行文件 │ ├─Debug │ │ WireRouting.exe | | WireRouting_DLL.dll | └─src \\编译目标源文件 xmlsql.cpp ``` ## 运行环境配置 - CMake配置 - 确认Cmake已安装: [Download CMake](https://cmake.org/download/#latest) - 添加**cmake.exe**至环境变量 - 确认编译器已安装,如VS2022、VS2019等环境 ## 使用CMake构建项目 ``` # 进入项目目录 cd # Standard CMake build # 注意项目所用链接库均为 Debug x64 编译,构建务必使用同规格 cmake -S . -B build -T host=x64 -A x64 cmake --build build --config Debug --target ALL_BUILD -j 14 ``` ## 运行 ``` # 进入可执行文件所在目录 cd \build\Debug # OPTION:执行预编译程序 # cd \pre_build\Debug # 运行 .\WireRouting.exe createTinyroute "..\\..\\data\\Tinyroute_test\\clip2" "..\\..\\data\\Tinyroute_test\\wirexml" "..\\..\\data\\Tinyroute_test\\connector.csv" "..\\..\\data\\Tinyroute_test\\OBJ" output ``` ## 查看结果 > 在 **\build\Debug\output_ALL.txt** 目录下查看输出文件 > > 可与 **\data\Tinyroute_test\result_ALL.txt** 比较结果