21 lines
502 B
CMake
Raw Permalink Normal View History

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