added CMake package configuration files (#246)
This commit is contained in:
parent
5876a2b11d
commit
b388750a8d
@ -155,6 +155,18 @@ install(
|
|||||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Install targets
|
||||||
|
#
|
||||||
|
|
||||||
|
install(EXPORT uvwConfig NAMESPACE uvw:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/uvw)
|
||||||
|
install(TARGETS uvw EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
if(FETCH_LIBUV AND BUILD_UVW_LIBS)
|
||||||
|
# libuv is only fetched when both above conditions are true
|
||||||
|
install(TARGETS uv_a EXPORT uvwConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
install(TARGETS uv EXPORT uvwConfig LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
endif(FETCH_LIBUV AND BUILD_UVW_LIBS)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Pkg-Config
|
# Pkg-Config
|
||||||
#
|
#
|
||||||
|
|||||||
@ -57,34 +57,26 @@ function(add_uvw_library LIB_NAME)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build and install libraries
|
# Build and install libraries
|
||||||
#
|
#
|
||||||
|
|
||||||
if (BUILD_UVW_SHARED_LIB)
|
if (BUILD_UVW_SHARED_LIB)
|
||||||
add_library(uvw-shared SHARED)
|
add_library(uvw SHARED)
|
||||||
add_library(uvw::uvw-shared ALIAS uvw-shared)
|
add_library(uvw::uvw-shared ALIAS uvw)
|
||||||
target_link_libraries(uvw-shared PUBLIC $<$<TARGET_EXISTS:uv::uv-shared>:uv::uv-shared>)
|
# If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage.
|
||||||
set_target_properties(uvw-shared PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
|
|
||||||
|
|
||||||
add_uvw_library(uvw-shared)
|
|
||||||
|
|
||||||
install(TARGETS uvw-shared EXPORT uvw ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(FETCH_LIBUV)
|
if(FETCH_LIBUV)
|
||||||
install(TARGETS uv_a EXPORT uvw ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
target_link_libraries(uvw PUBLIC uv::uv-shared)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_library(uvw-static STATIC)
|
add_library(uvw STATIC)
|
||||||
add_library(uvw::uvw-static ALIAS uvw-static)
|
add_library(uvw::uvw-static ALIAS uvw)
|
||||||
target_link_libraries(uvw-static PUBLIC $<$<TARGET_EXISTS:uv::uv-static>:uv::uv-static> $<$<NOT:$<TARGET_EXISTS:uv::uv-static>>:uv_a dl>)
|
# If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage.
|
||||||
set_target_properties(uvw-static PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
|
|
||||||
|
|
||||||
add_uvw_library(uvw-static)
|
|
||||||
|
|
||||||
install(TARGETS uvw-static EXPORT uvw ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(FETCH_LIBUV)
|
if(FETCH_LIBUV)
|
||||||
install(TARGETS uv EXPORT uvw LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
target_link_libraries(uvw PUBLIC uv::uv-static)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_library(uvw::uvw ALIAS uvw)
|
||||||
|
set_target_properties(uvw PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
|
||||||
|
add_uvw_library(uvw)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user