Bug 948948 - Should provide pkgconfig in openlmi-providers-devel
Summary: Should provide pkgconfig in openlmi-providers-devel
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: openlmi-providers
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Radek Novacek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-05 14:44 UTC by John Dennis
Modified: 2016-12-01 00:31 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-22 08:57:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John Dennis 2013-04-05 14:44:58 UTC
The providers for OpenLMI are intended to use common utility routines which are shared by all providers. These utilities are in the openlmicommon library. The definitions for the content of libopenlmicommon is in globals.h, when openlmi-providers-devel is installed globals.h appears in /usr/include/openlmi.

If you are building an openlmi provider outside of the openlmi package you should be able to find the definitions for the headers and library by a standard mechanism., pkgconfig is the standard mechanism. As it stands now one has to hardcode this information into your build, hardcoding should be avoided.

Also OpenLMI has adopted CMake as it's preferred build system. One should be able to follow CMake conventions for finding headers and libraries.

It is suggested that openlmi-providers-devel install a pkgconfig file. This would support both projects using CMake and those which do not and would follow existing Linux conventions (pkgconfig is fairly universal)

In a CMakeLists.txt file one could then have something like this:

find_package(PkgConfig QUIET)
pkg_check_modules(OPENLMI openlmi-1.0 REQUIRED)

include_directories(${CMAKE_CURRENT_BINARY_DIR}
                    ${CMPI_INCLUDE_DIR}
                    ${OPENLMI_INCLUDE_DIR}
                    )

target_link_libraries(${LIBRARY_NAME}
                      ${OPENLMI_LIBRARIES
                      ${KONKRETCMPI_LIBRARIES}
                      )

Note the use of ${OPENLMI_*} variables in the above snippet.

If you wanted to add CMake macros to explicitly set the header and library definitions one could do that as well, but a pkgconfig should still be provided because that's a standard mechanism and it would support projects not using CMake.

I expect a number of providers will be using the CMake pkgconfig support anyway for their other dependencies.

Bottom line: we need a mechanism which does not require hardcoding the include file location and library name into build scripts and works for external building.

P.S.: Should we consider renaming globals.h to something more specific? It's a bit generic for a public header and really doesn't convey it's contents.

Comment 1 Radek Novacek 2013-04-11 14:04:30 UTC
I've made upstream review request with implementation of these suggestions:

https://reviewboard-openlmi.rhcloud.com/r/185/


Can you comment if this is what you meant?

Comment 2 John Dennis 2013-04-11 14:21:11 UTC
I didn't see any patches, diffs, attachments etc. on either the reviewboard or here in the bz. Am I looking in the wrong place?

Comment 3 Radek Novacek 2013-04-22 08:57:06 UTC
This change has been applied upstream. It will be part of next release of openlmi-providers in Fedora.


Note You need to log in before you can comment on or make changes to this bug.