cmake_minimum_required(VERSION 3.10) project(XNModelGenTest) # 设置C++标准 set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) # 查找必要的库 find_library(DL_LIBRARY dl) # 创建测试可执行文件 add_executable(test_xnmodel test_xnmodel.cpp) # 链接动态库 target_link_libraries(test_xnmodel ${DL_LIBRARY}) # 设置运行时库路径 set_target_properties(test_xnmodel PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH "${CMAKE_SOURCE_DIR}/.." )