添加package配置。
This commit is contained in:
16
cmake/cxxLibrary.cmake.in
Normal file
16
cmake/cxxLibrary.cmake.in
Normal 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}")
|
||||
Reference in New Issue
Block a user