On Thursday 29 November 2012, Stephen Kelly wrote:
...
> The tier1 Config files (after CMake 2.8.11) should only contain this:
> 
>  set(kwidgetsaddons_VERSION_MAJOR "@KWIDGETSADDONS_VERSION_MAJOR@")
>  set(kwidgetsaddons_VERSION_MINOR "@KWIDGETSADDONS_VERSION_MINOR@")
>  set(kwidgetsaddons_VERSION_PATCH "@KWIDGETSADDONS_VERSION_PATCH@")
> 
>  if (NOT TARGET KF5::widgetsaddons) # See item 1.
>    include("${CMAKE_CURRENT_LIST_DIR}/kwidgetsaddonsTargets.cmake")
>  endif()
> 
>  include(FooMacros.cmake) # As required.
> 
> The tier2 and higher config files need also to find_package their
> dependencies.
> 
> If you think anything else is needed (apart from for compatibility
> variables, which we can provide separately - there is no need for
> compatibility variables for kwidgetaddons as it has not existed before),
> then please let me know and we can make sure that it can be done with
> IMPORTED targets instead.

Please have a look at the current solidConfig.cmake.in.
This is mostly as I think it should be (the include-guard is still missing).

It now also contains user-documentation and some package-specific information, 
which I consider useful, whether for using solid or for figuring out what the 
installed solid version does, as well as the proper DIRS and LIBRARIES 
variables.

Alex
# solidConfig.cmake provides information about the installed solid library.
# It can be used directly from CMake via find_package(solid NO_MODULE)
#
# The following CMake variables are provided:
#   solid_VERSION_MAJOR - the major version number of solid
#   solid_VERSION_MINOR - the minor version number of solid
#   solid_VERSION_PATCH - the patch version number of solid
#   solid_INCLUDE_DIRS  - the include directories to use
#   solid_LIBRARIES     - the libraries to link against
#   solid_LIBRARY_DIR   - the directory where the solid libraries are installed. This may be useful for setting RPATH.
#   solid_HAVE_WINDOWS_WBEM - TRUE if WBEM is supported as backend under Windows
#   solid_HAVE_HerqqUPnP    - TRUE if UPnP via Herqq (http://www.herqq.org) is supported
#   solid_HAVE_UDev         - TRUE if device discovery via udev is supported
#   solid_USE_UDisk2        - TRUE is udisk2 is used instead of udisk on UNIX systems
#
# Additionally, the following imported library targets are created, which may be used directly
# with target_link_libraries():
#   KF5::solid - the solid library


####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)

macro(set_and_check _var _file)
  set(${_var} "${_file}")
  if(NOT EXISTS "${_file}")
    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  endif()
endmacro()

macro(check_required_components _NAME)
  foreach(comp ${${_NAME}_FIND_COMPONENTS})
    if(NOT ${_NAME}_${comp}_FOUND)
      if(${_NAME}_FIND_REQUIRED_${comp})
        set(${_NAME}_FOUND FALSE)
      endif()
    endif()
  endforeach()
endmacro()

####################################################################################

# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file.

set(solid_VERSION_MAJOR "5")
set(solid_VERSION_MINOR "0")
set(solid_VERSION_PATCH "0")

set(solid_INSTALL_PREFIX "${PACKAGE_PREFIX_DIR}")
set_and_check(solid_INCLUDE_DIR    "${PACKAGE_PREFIX_DIR}/include")
set_and_check(solid_LIBRARY_DIR    "${PACKAGE_PREFIX_DIR}/lib")

include("${CMAKE_CURRENT_LIST_DIR}/solidTargets.cmake")

set(solid_LIBRARY KF5::solid)  # is this one needed ?

# "public" variables:

set(solid_INCLUDE_DIRS "${solid_INCLUDE_DIR}" )
set(solid_LIBRARIES KF5::solid )

set(solid_HAVE_WINDOWS_WBEM FALSE )

set(solid_HAVE_HerqqUPnP FALSE )

set(solid_HAVE_UDev TRUE )

set(solid_USE_UDisk2 OFF )

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to