mirror of https://github.com/microsoft/vcpkg.git
[lcms] update config for windows dynamic so dll's get exported (#52697)
Co-authored-by: Angel Sánchez <angelsanchez@inedit.com> Co-authored-by: Kai Pastor <dg0yt@darc.de> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
fab1c6dc7a
commit
08f20962d3
|
|
@ -1,25 +1,72 @@
|
|||
if(NOT TARGET lcms2::lcms2)
|
||||
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)
|
||||
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
find_library(LCMS2_LIBRARY_DEBUG NAMES lcms2 PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_DEBUG}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_DEBUG "${LCMS2_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
find_library(LCMS2_LIBRARY_RELEASE NAMES lcms2 PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_RELEASE}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_RELEASE "${LCMS2_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
unset(_IMPORT_PREFIX)
|
||||
endif()
|
||||
if(NOT TARGET lcms2::lcms2)
|
||||
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)
|
||||
|
||||
function(lcms2_find_runtime_dll _out_var _bin_dir)
|
||||
file(GLOB _candidates "${_bin_dir}/*lcms2*.dll")
|
||||
foreach(_candidate IN LISTS _candidates)
|
||||
get_filename_component(_name "${_candidate}" NAME)
|
||||
if(_name MATCHES "^(lib)?lcms2-[0-9]+\.dll")
|
||||
set(${_out_var} "${_candidate}" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
set(${_out_var} "" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Using SHARED IMPORTED on Windows DLL builds is required so that:
|
||||
# IMPORTED_IMPLIB_* carries the import library (.lib) used for linking
|
||||
# IMPORTED_LOCATION_* carries the runtime DLL used by TARGET_RUNTIME_DLLS
|
||||
if(WIN32)
|
||||
lcms2_find_runtime_dll(LCMS2_RELEASE_DLL "${_IMPORT_PREFIX}/bin")
|
||||
if(LCMS2_RELEASE_DLL)
|
||||
add_library(lcms2::lcms2 SHARED IMPORTED)
|
||||
else()
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED)
|
||||
endif()
|
||||
unset(LCMS2_RELEASE_DLL)
|
||||
else()
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED)
|
||||
endif()
|
||||
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
find_library(LCMS2_LIBRARY_DEBUG NAMES lcms2 PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_DEBUG}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
|
||||
lcms2_find_runtime_dll(LCMS2_DLL_DEBUG "${_IMPORT_PREFIX}/debug/bin")
|
||||
if(LCMS2_DLL_DEBUG)
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
IMPORTED_IMPLIB_DEBUG "${LCMS2_LIBRARY_DEBUG}"
|
||||
IMPORTED_LOCATION_DEBUG "${LCMS2_DLL_DEBUG}"
|
||||
)
|
||||
else()
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LCMS2_LIBRARY_DEBUG}"
|
||||
)
|
||||
endif()
|
||||
unset(LCMS2_DLL_DEBUG)
|
||||
endif()
|
||||
|
||||
find_library(LCMS2_LIBRARY_RELEASE NAMES lcms2 PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_RELEASE}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
|
||||
lcms2_find_runtime_dll(LCMS2_DLL_RELEASE "${_IMPORT_PREFIX}/bin")
|
||||
if(LCMS2_DLL_RELEASE)
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${LCMS2_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_RELEASE "${LCMS2_DLL_RELEASE}"
|
||||
)
|
||||
else()
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LCMS2_LIBRARY_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
unset(LCMS2_DLL_RELEASE)
|
||||
endif()
|
||||
|
||||
unset(_IMPORT_PREFIX)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "lcms",
|
||||
"version": "2.19.1",
|
||||
"port-version": 1,
|
||||
"description": "Little CMS.",
|
||||
"homepage": "https://github.com/mm2/Little-CMS",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -4670,7 +4670,7 @@
|
|||
},
|
||||
"lcms": {
|
||||
"baseline": "2.19.1",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"lely-core": {
|
||||
"baseline": "2.3.5",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "18ab2c77128f44e6439741effc3f62ccaa9f36f7",
|
||||
"version": "2.19.1",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "ae3a606e2990806e4beae526422426116a9ea56d",
|
||||
"version": "2.19.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue