-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[giflib] Fix multi-config
find_package(GIF)
(#27369)
* Fix multi-config find_package(GIF) * Update versions * Fix invalid vcpkg tool output * Update versions
- Loading branch information
Showing
6 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The package giflib is compatible with built-in CMake targets: | ||
|
||
find_package(GIF REQUIRED) | ||
target_link_libraries(main PRIVATE GIF::GIF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
find_path(GIF_INCLUDE_DIR NAMES gif_lib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) | ||
find_library(GIF_LIBRARY_RELEASE NAMES gif PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) | ||
find_library(GIF_LIBRARY_DEBUG NAMES gif PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) | ||
include(SelectLibraryConfigurations) | ||
select_library_configurations(GIF) | ||
set(GIF_LIBRARY "${GIF_LIBRARY}" CACHE STRING "") | ||
unset(GIF_LIBRARY) | ||
unset(GIF_FOUND) | ||
if(NOT TARGET GIF::GIF) | ||
add_library(GIF::GIF UNKNOWN IMPORTED) | ||
set_target_properties(GIF::GIF PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}" | ||
IMPORTED_CONFIGURATIONS RELEASE | ||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" | ||
IMPORTED_LOCATION_RELEASE "${GIF_LIBRARY_RELEASE}" | ||
) | ||
if("${GIF_LIBRARY_DEBUG}") | ||
set_property(TARGET GIF::GIF APPEND PROPERTY | ||
IMPORTED_CONFIGURATIONS DEBUG) | ||
set_target_properties(GIF::GIF PROPERTIES | ||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" | ||
IMPORTED_LOCATION_DEBUG "${GIF_LIBRARY_DEBUG}") | ||
endif() | ||
endif() | ||
_find_package(${ARGS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters