2019-09-12 03:57:02 +08:00
|
|
|
_find_package(${ARGS})
|
2023-05-31 09:43:30 +08:00
|
|
|
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin"))
|
2019-09-12 03:57:02 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|
|
|
list(APPEND OpenCL_Extra_Libs cfgmgr32)
|
2023-05-31 09:43:30 +08:00
|
|
|
if($ENV{WindowsSDKVersion} MATCHES "^10")
|
|
|
|
list(APPEND OpenCL_Extra_Libs OneCoreUAP)
|
|
|
|
endif()
|
2019-09-12 03:57:02 +08:00
|
|
|
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|
|
|
|
|
|
|
if(TARGET OpenCL::OpenCL)
|
|
|
|
set_property(TARGET OpenCL::OpenCL APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${OpenCL_Extra_Libs})
|
|
|
|
endif()
|
|
|
|
if(OpenCL_LIBRARIES)
|
|
|
|
list(APPEND OpenCL_LIBRARIES ${OpenCL_Extra_Libs})
|
|
|
|
endif()
|
2023-05-31 09:43:30 +08:00
|
|
|
unset(OpenCL_Extra_Libs)
|
|
|
|
endif()
|