mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 15:09:01 +08:00
8fc4b4b950
* creating braft port * format manifest * version * Refix * version * Add dependency brpc * version * Add license * version * Fix dependency gflags, fix export include path * version * Re-fix dependency * version * Re-fix gflags * version * Add find_dependency * version Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index 78adc56..ff435a2 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -19,8 +19,10 @@ add_library(braft-static STATIC $<TARGET_OBJECTS:OBJ_LIB>)
|
|
endif()
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
+target_include_directories(braft-shared PUBLIC $<INSTALL_INTERFACE:include>)
|
|
target_link_libraries(braft-shared PUBLIC ${DYNAMIC_LIB})
|
|
else()
|
|
+target_include_directories(braft-static PUBLIC $<INSTALL_INTERFACE:include>)
|
|
target_link_libraries(braft-static PUBLIC ${DYNAMIC_LIB})
|
|
endif()
|
|
|
|
@@ -31,15 +33,30 @@ SET_TARGET_PROPERTIES(braft-shared PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUT
|
|
endif()
|
|
|
|
if (NOT BUILD_SHARED_LIBS)
|
|
-install(TARGETS braft-static
|
|
+install(TARGETS braft-static EXPORT unofficial-braftTargets
|
|
RUNTIME DESTINATION bin
|
|
LIBRARY DESTINATION lib${LIBSUFFIX}
|
|
ARCHIVE DESTINATION lib${LIBSUFFIX}
|
|
)
|
|
else()
|
|
-install(TARGETS braft-shared
|
|
+install(TARGETS braft-shared EXPORT unofficial-braftTargets
|
|
RUNTIME DESTINATION bin
|
|
LIBRARY DESTINATION lib${LIBSUFFIX}
|
|
ARCHIVE DESTINATION lib${LIBSUFFIX}
|
|
)
|
|
endif()
|
|
+
|
|
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-braft-config.cmake"
|
|
+[[include(CMakeFindDependencyMacro)
|
|
+find_dependency(gflags CONFIG)
|
|
+file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/unofficial-braftTargets.cmake")
|
|
+foreach (TARGET_FILE ${TARGET_FILES})
|
|
+ include("${TARGET_FILE}")
|
|
+endforeach()
|
|
+]])
|
|
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-braft-config.cmake" DESTINATION share/unofficial-braft)
|
|
+
|
|
+install(EXPORT unofficial-braftTargets
|
|
+ NAMESPACE unofficial::braft::
|
|
+ DESTINATION share/unofficial-braft
|
|
+)
|