mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
e1f3eecdeb
* [skia] Build configuration fix * [skia] Changed declared port-version
49 lines
1.9 KiB
CMake
49 lines
1.9 KiB
CMake
add_library(skia INTERFACE)
|
|
add_library(skia::skia ALIAS skia)
|
|
set(SKIA_DEP_DBG @SKIA_DEP_DBG@)
|
|
set(SKIA_DEP_REL @SKIA_DEP_REL@)
|
|
set(SKIA_DEFINITIONS_DBG @SKIA_DEFINITIONS_DBG@)
|
|
set(SKIA_DEFINITIONS_REL @SKIA_DEFINITIONS_REL@)
|
|
|
|
# Compute the installation prefix relative to this file.
|
|
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
if(_IMPORT_PREFIX STREQUAL "/")
|
|
set(_IMPORT_PREFIX "")
|
|
endif()
|
|
|
|
find_library(SKIA_LIB_DBG NAMES skia skia.dll PATHS ${_IMPORT_PREFIX}/debug/lib NO_DEFAULT_PATH)
|
|
find_library(SKIA_LIB_REL NAMES skia skia.dll PATHS ${_IMPORT_PREFIX}/lib NO_DEFAULT_PATH)
|
|
target_link_libraries(skia INTERFACE "$<$<CONFIG:Debug>:${SKIA_LIB_DBG}>")
|
|
target_link_libraries(skia INTERFACE "$<$<CONFIG:Release>:${SKIA_LIB_REL}>")
|
|
|
|
function(set_dependencies CONFIG LIBRARIES)
|
|
foreach(LIB ${LIBRARIES})
|
|
if(LIB MATCHES "^/")
|
|
if(WIN32)
|
|
string(SUBSTRING "${LIB}" 1 -1 LIB)
|
|
endif()
|
|
target_link_libraries(skia INTERFACE
|
|
"$<$<CONFIG:${CONFIG}>:${LIB}>")
|
|
else()
|
|
string(REGEX REPLACE "\\.framework" "" LIB ${LIB})
|
|
string(REGEX REPLACE "[^a-zA-Z]" "_" LIB_NAME ${LIB})
|
|
string(TOUPPER ${LIB_NAME} LIB_NAME)
|
|
set(LIB_NAME SKIA_${LIB_NAME}_LIBRARY)
|
|
find_library(${LIB_NAME} ${LIB})
|
|
target_link_libraries(skia INTERFACE
|
|
"$<$<CONFIG:${CONFIG}>:${${LIB_NAME}}>")
|
|
endif()
|
|
endforeach()
|
|
endfunction()
|
|
|
|
set_dependencies(Debug "${SKIA_DEP_DBG}")
|
|
set_dependencies(Release "${SKIA_DEP_REL}")
|
|
|
|
target_compile_definitions(skia INTERFACE
|
|
$<$<CONFIG:Debug>:${SKIA_DEFINITIONS_DBG}>
|
|
$<$<CONFIG:Release>:${SKIA_DEFINITIONS_REL}>)
|
|
|
|
target_include_directories(skia INTERFACE ${_IMPORT_PREFIX}/include)
|