[PATCH] Clean up FindGObject.cmake.

Alexander Neundorf neundorf at kde.org
Mon Apr 11 22:03:55 CEST 2011


On Monday 11 April 2011, Raphael Kubo da Costa wrote:
>  * Remove unnecessary WIN32 check.
>  * Use the pkg-config paths as HINTS, not PATHS.
>  * Use FindPackageHandleStandardArgs instead of duplicating its
>    functionality.

Looks good except one thing:

> ---
>  cmake/modules/FindGObject.cmake |   52
> +++++++++------------------------------ 1 files changed, 12 insertions(+),
> 40 deletions(-)
...
>  SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs}
> ${_GLibs} )
>
> -IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
> -   SET(GOBJECT_FOUND TRUE)
> -ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
> -   SET(GOBJECT_FOUND FALSE)
> -ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
> -
> -IF (GOBJECT_FOUND)
> -   IF (NOT GObject_FIND_QUIETLY)
> -      MESSAGE(STATUS "Found GObject libraries: ${GOBJECT_LIBRARIES}")
> -      MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}")
> -   ENDIF (NOT GObject_FIND_QUIETLY)
> -ELSE (GOBJECT_FOUND)
> -    IF (GObject_FIND_REQUIRED)
> -      MESSAGE(STATUS "Could NOT find GObject")
> -    ENDIF(GObject_FIND_REQUIRED)
> -ENDIF (GOBJECT_FOUND)
> +INCLUDE(FindPackageHandleStandardArgs)
> +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GOBJECT DEFAULT_MSG GOBJECT_LIBRARIES
> GOBJECT_INCLUDE_DIR)
>
> -MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs
>                   _GLibs) 
> +MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs
>                  _GLibs GOBJECT_LIBRARIES)


GOBJECT_LIBRARIES is set using SET(), so it is not in the cache, and so it 
doesn't has to be marked as advanced (because normal variables are not at all 
in the cache.

Alex


More information about the Kde-buildsystem mailing list