mirror of
https://github.com/civetweb/civetweb
synced 2025-03-28 21:13:27 +00:00
fix: properly lookup winsock in imported project
This commit is contained in:
parent
8e24345696
commit
ba5f5968ea
@ -603,6 +603,9 @@ install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibDL.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibRt.cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindWinSock.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
COMPONENT civetweb-cmake-config
|
||||
)
|
||||
|
@ -3,4 +3,24 @@ include(CMakeFindDependencyMacro)
|
||||
|
||||
set_and_check(civetweb_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
|
||||
|
||||
find_dependency(Threads)
|
||||
|
||||
set(CIVETWEB_SAVED_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
if(@LOOKUP_LIBDL@)
|
||||
find_dependency(LibDl)
|
||||
endif()
|
||||
|
||||
if(@LOOKUP_LIBRT@)
|
||||
find_dependency(LibRt)
|
||||
endif()
|
||||
|
||||
if(@LOOKUP_WINSOCK@)
|
||||
find_dependency(WinSock)
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CIVETWEB_SAVED_MODULE_PATH})
|
||||
unset(CIVETWEB_SAVED_MODULE_PATH)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/civetweb-targets.cmake")
|
||||
|
@ -322,3 +322,23 @@ if (CIVETWEB_ENABLE_CXX)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
COMPONENT civetweb-cpp)
|
||||
endif()
|
||||
|
||||
# Configure lookup behavior in civetweb config
|
||||
|
||||
if(LIBDL_FOUND)
|
||||
set(LOOKUP_LIBDL TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(LOOKUP_LIBDL FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(LIBRT_FOUND)
|
||||
set(LOOKUP_LIBRT TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(LOOKUP_LIBRT FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(WINSOCK_FOUND)
|
||||
set(LOOKUP_WINSOCK TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(LOOKUP_WINSOCK FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user