Conversation
| _find_package(unofficial-giflib CONFIG REQUIRED) | ||
| add_library(GIF::GIF ALIAS unofficial::giflib::gif) | ||
|
|
||
| get_filename_component(GIF_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}" PATH) | ||
| get_filename_component(GIF_INCLUDE_DIRS "${LUA_INCLUDE_DIR}" PATH) | ||
|
|
||
| set(GIF_FOUND TRUE) | ||
| set(GIF_INCLUDE_DIRS ${_IMPORT_PREFIX}/include) | ||
| set(GIF_LIBRARIES unofficial::giflib::gif) | ||
| set(GIF_VERSION @GIFLIB_VERSION@) | ||
|
|
||
| unset(_IMPORT_PREFIX) |
There was a problem hiding this comment.
So many error in a short file!
And I repeat that you don't need exported config. Cf. zlib.
There was a problem hiding this comment.
@dg0yt I think this should be okay. what are you worried about?
dg0yt
left a comment
There was a problem hiding this comment.
And again, do not implement this with imported config. It is just a simple lib without dependencies.
| @@ -0,0 +1,12 @@ | |||
| _find_package(unofficial-giflib CONFIG REQUIRED) | |||
| add_library(GIF::GIF ALIAS unofficial::giflib::gif) | |||
There was a problem hiding this comment.
This must be guarded by if(NOT TARGET GIF::GIF).
You must not use ALIAS here.
There was a problem hiding this comment.
This must be guarded by
if(NOT TARGET GIF::GIF).
Agreed.
You must not use ALIAS here.
Why?
Our goal is to be fully compatible with FindGIF.cmake, so we should provide all the targets and macros that cmake provides in FindGIF.
There was a problem hiding this comment.
ALIAS is for internal use in a CMake project. But this is exported config. You can use Given the vendored INTERFACE libraries.CMakeLists.txt, you can just directly export GIF::GIF.
There was a problem hiding this comment.
ALIASis for internal use in a CMake project. But this is exported config.You can useGiven the vendoredINTERFACElibraries.CMakeLists.txt, you can just directly exportGIF::GIF.
I think not, GIF::GIF is provided by cmake, not by giflib officially.
There was a problem hiding this comment.
FindGIF.cmake from CMake is defining the official interface of find_package(GIF). So yes, just export GIF::GIF directly, "to be fully compatible with FindGIF.cmake".
Or don't export anything, and use plain find_library and select_library_configurations, as we do in other ports.
There was a problem hiding this comment.
You must not use ALIAS here.
Why?
And CMake 3.7.2 even doesn't allow this alias:
CMake Error at /Users/vagrant/Data/work/1/s/scripts/buildsystems/vcpkg.cmake:618 (_add_library):
add_library cannot create ALIAS target "GIF::GIF" because target
"unofficial::giflib::gif" is IMPORTED.
Hint: You can build test port cmake-user locally before pushing the next update.
| endif() | ||
|
|
||
| add_library(gif ${GIFLIB_SOURCES}) | ||
| add_library(GIF ${GIFLIB_SOURCES}) |
There was a problem hiding this comment.
We need to set the OUTPUT_NAME to lower-case gif now. Then x64-linux will be happy.
|
Why not to set |
|
Any chance this might be completed? |
I will continue to fix this in the next week. |
|
Closed as duplicate of #27369. |
Describe the pull request
What does your PR fix?
Fixes [giflib] Debug library linked in release configuration #26833, add export CMake and fix Release mode depends on Debug lib.Usage have test pass.