forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libhv] Export CMake config files (microsoft#25042)
* [libhv] Export CMake config files * x-add-version * update patch * x-add-version Co-authored-by: Lily Wang <[email protected]>
- Loading branch information
1 parent
d431830
commit 3e7517b
Showing
5 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index f478fb4..1e3556a 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -196,9 +196,10 @@ list_source_directories(LIBHV_SRCS ${LIBHV_SRCDIRS}) | ||
if(BUILD_SHARED) | ||
add_library(hv SHARED ${LIBHV_SRCS}) | ||
target_compile_definitions(hv PRIVATE HV_DYNAMICLIB) | ||
- target_include_directories(hv PRIVATE ${LIBHV_SRCDIRS}) | ||
+ target_include_directories(hv PRIVATE ${LIBHV_SRCDIRS} INTERFACE $<INSTALL_INTERFACE:include>) | ||
target_link_libraries(hv ${LIBS}) | ||
install(TARGETS hv | ||
+ EXPORT libhvConfig | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin) | ||
@@ -208,14 +209,17 @@ endif() | ||
if(BUILD_STATIC) | ||
add_library(hv_static STATIC ${LIBHV_SRCS}) | ||
target_compile_definitions(hv_static PRIVATE HV_STATICLIB) | ||
- target_include_directories(hv_static PRIVATE ${LIBHV_SRCDIRS}) | ||
+ target_include_directories(hv_static PRIVATE ${LIBHV_SRCDIRS} INTERFACE $<INSTALL_INTERFACE:include>) | ||
target_link_libraries(hv_static ${LIBS}) | ||
- install(TARGETS hv_static DESTINATION lib) | ||
+ install(TARGETS hv_static | ||
+ EXPORT libhvConfig | ||
+ ARCHIVE DESTINATION lib) | ||
add_custom_target(libhv_static DEPENDS hv_static) | ||
endif() | ||
|
||
file(INSTALL ${LIBHV_HEADERS} DESTINATION include/hv) | ||
install(FILES ${LIBHV_HEADERS} DESTINATION include/hv) | ||
+install(EXPORT libhvConfig DESTINATION lib/cmake/libhv) | ||
|
||
if(BUILD_SHARED) | ||
set(HV_LIBRARIES hv CACHE INTERNAL "link hv libraries") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters