添加package配置。

This commit is contained in:
2026-03-24 08:57:02 +08:00
parent e13b3650e9
commit df9ad3fc4e
4 changed files with 159 additions and 5 deletions

16
cmake/cxxLibrary.cmake.in Normal file
View File

@@ -0,0 +1,16 @@
@PACKAGE_INIT@
# 包含导出的目标文件
include("${CMAKE_CURRENT_LIST_DIR}/cxxLibraryTargets.cmake")
# 手动设置包含路径
get_target_property(cxxLibrary_INCLUDE_DIRS cxxLibrary::cxxLibrary INTERFACE_INCLUDE_DIRECTORIES)
if(NOT cxxLibrary_INCLUDE_DIRS)
set(cxxLibrary_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
endif()
# 设置找到的变量
set(cxxLibrary_VERSION @PROJECT_VERSION@)
set(cxxLibrary_VERSION_STRING "@PROJECT_VERSION@")
set(cxxLibrary_FOUND TRUE)
message(STATUS "Found cxxLibrary version ${cxxLibrary_VERSION}")