diff --git a/CMakeLists.txt b/CMakeLists.txt index 1aa530a..615739c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,3 +69,14 @@ if(BUILD_TESTING OR NOT DEFINED BUILD_TESTING) target_link_libraries(test_datarouter DataRouter) add_test(NAME datarouter COMMAND test_datarouter) endif() + +# ── 安装规则(用于打包发布) ───────────────────────────── + +include(GNUInstallDirs) +install(TARGETS DataRouter ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/datarouter.h + ${CMAKE_CURRENT_SOURCE_DIR}/datarouter_config.h + ${CMAKE_CURRENT_SOURCE_DIR}/datarouter_config_template.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +)