Review Request 112151: Use components in FindXCB

Martin Gräßlin mgraesslin at kde.org
Wed Sep 4 07:45:16 UTC 2013



On Sept. 4, 2013, 9:26 a.m., Martin Gräßlin wrote:
> > Here's a diff fixing the issues:
> > 
> > diff --git a/find-modules/FindXCB.cmake b/find-modules/FindXCB.cmake
> > index 2684ed0..823d167 100644
> > --- a/find-modules/FindXCB.cmake
> > +++ b/find-modules/FindXCB.cmake
> > @@ -60,9 +60,15 @@ unset(unknownComponents)
> >  set(pkgConfigModules)
> >  set(requiredComponents)
> >  
> > +if (XCB_FIND_COMPONENTS)
> > +  set(comps ${XCB_FIND_COMPONENTS})
> > +else()
> > +  set(comps ${knownComponents})
> > +endif()
> > +
> >  # iterate through the list of requested components, and check that we know them all.
> >  # If not, fail.
> > -foreach(comp ${XCB_FIND_COMPONENTS})
> > +foreach(comp ${comps})
> >      list(FIND knownComponents ${comp} index )
> >      if("${index}" STREQUAL "-1")
> >          list(APPEND unknownComponents "${comp}")
> > @@ -183,16 +189,17 @@ macro(_XCB_HANDLE_COMPONENT _comp)
> >          set(_lib "xcb-xv")
> >      endif()
> >  
> > -    find_path(XCB_${_comp}_INCLUDE_DIR NAMES xcb/${header} HINTS ${PKG_XCB_INCLUDE_DIRS})
> > +    find_path(XCB_${_comp}_INCLUDE_DIR NAMES ${_header} HINTS ${PKG_XCB_INCLUDE_DIRS})
> >      find_library(XCB_${_comp}_LIBRARY NAMES ${_lib} HINTS ${PKG_XCB_LIBRARY_DIRS})
> >  
> > -    if(NOT XCB_FIND_QUIETLY)
> > -        message(STATUS "XCB[${_comp}]: Found component ${_comp}")
> > +    if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
> > +        list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
> > +        list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
> > +        if (NOT XCB_FIND_QUIETLY)
> > +            message(STATUS "XCB[${_comp}]: Found component ${_comp}")
> > +        endif()
> >      endif()
> >  
> > -    list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
> > -    list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
> > -
> >      if(XCB_FIND_REQUIRED_${_comp})
> >          list(APPEND requiredComponents XCB_${_comp}_FOUND)
> >      endif()
> > @@ -210,16 +217,18 @@ IF (NOT WIN32)
> >      include(FindPackageHandleStandardArgs)
> >      # Use pkg-config to get the directories and then use these values
> >      # in the FIND_PATH() and FIND_LIBRARY() calls
> > -    FIND_PACKAGE(PkgConfig)
> > -    PKG_CHECK_MODULES(PKG_XCB QUIET ${pkgConfigModules})
> > +    find_package(PkgConfig)
> > +    pkg_check_modules(PKG_XCB QUIET ${pkgConfigModules})
> >  
> > -    SET(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
> > +    set(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
> >  
> > -    foreach(comp ${XCB_FIND_COMPONENTS})
> > +    foreach(comp ${comps})
> >          _xcb_handle_component(${comp})
> >      endforeach()
> >  
> > -    list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
> > +    if(XCB_INCLUDE_DIRS)
> > +        list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
> > +    endif()
> >  
> >      find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS ${requiredComponents})
> >  
> >

thanks a lot for the patch.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112151/#review39310
-----------------------------------------------------------


On Sept. 4, 2013, 6:57 a.m., Martin Gräßlin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112151/
> -----------------------------------------------------------
> 
> (Updated Sept. 4, 2013, 6:57 a.m.)
> 
> 
> Review request for KDE Frameworks, Alexander Neundorf and Stephen Kelly.
> 
> 
> Description
> -------
> 
> Instead of finding all or nothing from XCB it becomes components aware. So a user can just specify which XCB components it needs and compilation doesn't fail if a not-needed unrelated component is not found. It also allows to have some components as required and some as optional.
> 
> 
> Diffs
> -----
> 
>   find-modules/FindXCB.cmake 7e7e701 
> 
> Diff: http://git.reviewboard.kde.org/r/112151/diff/
> 
> 
> Testing
> -------
> 
> tested in kde-workspace
> 
> 
> Thanks,
> 
> Martin Gräßlin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130904/74d5897a/attachment.html>


More information about the Kde-frameworks-devel mailing list