mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
Fixes to install config setup.
This commit is contained in:
committed by
Fletcher Dunn
parent
0299cd9eac
commit
ad9e041c1a
@@ -18,12 +18,23 @@ endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/GameNetworkingSockets.cmake)
|
||||
|
||||
set_target_properties(
|
||||
GameNetworkingSockets::GameNetworkingSockets GameNetworkingSockets::GameNetworkingSockets_s
|
||||
PROPERTIES IMPORTED_GLOBAL True
|
||||
)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.11.0")
|
||||
# Need to set IMPORTED_GLOBAL in order to create the aliases
|
||||
# However, IMPORTED_GLOBAL only exists in 3.11 and up
|
||||
# Also, setting IMPORTED_GLOBAL from another directory from where it was first set blows up
|
||||
# so we can only set it once.
|
||||
|
||||
get_target_property(GNS_IMPORTED_GLOBAL_SET GameNetworkingSockets::GameNetworkingSockets IMPORTED_GLOBAL)
|
||||
|
||||
if(NOT ${GNS_IMPORTED_GLOBAL_SET})
|
||||
set_target_properties(
|
||||
GameNetworkingSockets::GameNetworkingSockets GameNetworkingSockets::GameNetworkingSockets_s
|
||||
PROPERTIES IMPORTED_GLOBAL True
|
||||
)
|
||||
endif()
|
||||
|
||||
unset(GNS_IMPORTED_GLOBAL_SET)
|
||||
|
||||
add_library(GameNetworkingSockets::shared ALIAS GameNetworkingSockets::GameNetworkingSockets)
|
||||
add_library(GameNetworkingSockets::static ALIAS GameNetworkingSockets::GameNetworkingSockets_s)
|
||||
endif()
|
||||
|
||||
@@ -315,6 +315,16 @@ if(NOT (USE_STEAMWEBRTC AND STEAMWEBRTC_ABSL_SOURCE STREQUAL submodule))
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Ensure that variables used in GameNetworkingSocketsConfig.cmake.in have some value
|
||||
# rather than an empty string.
|
||||
if(NOT USE_CRYPTO)
|
||||
set(USE_CRYPTO USE_CRYPTO-NOTFOUND)
|
||||
endif()
|
||||
|
||||
if(NOT STEAMWEBRTC_ABSL_SOURCE)
|
||||
set(STEAMWEBRTC_ABSL_SOURCE STEAMWEBRTC_ABSL_SOURCE-NOTFOUND)
|
||||
endif()
|
||||
|
||||
configure_package_config_file(../cmake/GameNetworkingSocketsConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/GameNetworkingSocketsConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/GameNetworkingSockets
|
||||
|
||||
Reference in New Issue
Block a user