Project

General

Profile

Feature #13392

Set CMAKE_PREFIX_PATH and PKG_CONFIG_PATH consistently

Added by Ben Morgan about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
08/02/2016
Due date:
% Done:

100%

Estimated time:
16.00 h
Spent time:
Co-Assignees:
Duration:

Description

To assist in using products for development of projects using CMake/Autotools etc, it would be useful for their UPS table files(?) to provide setting of the environment variables:

  • CMAKE_PREFIX_PATH
  • PKG_CONFIG_PATH

These would allow CMake's find_package (and the related find_path/find_library/find_program) command and the pkg-config program to find dependencies easily and reliably independent of whether cetbuildtools is used.

For example, in a CMake project, CMAKE_PREFIX_PATH has to be set by hand at the moment using the UPS X_FQ_DIR variables:

$ setup boost v1_16_0 -q e10:prof
$ setup sqlite v3_12_02_00
... or might have run setup_for_development ...
$ export CMAKE_PREFIX_PATH="${BOOST_FQ_DIR}:${SQLITE_FQ_DIR}" 
$ cmake <pathtosource>
... or without env or to override ...
$ cmake -DCMAKE_PREFIX_PATH="${BOOST_FQ_DIR};$SQLITE_FQ_DIR}" <pathtosource>

If each product's table file could add calls to pathPrepend for CMAKE_PREFIX_PATH (and PKG_CONFIG_PATH) with the relevant directories, this would greatly simplify setup. Some products partially support this already, e.g. the SQLite product prepends to PKG_CONFIG_PATH, but would be great to have it available for all products.

This is related to Issue #11929 in cetbuildtools.

History

#1 Updated by Kyle Knoepfel about 3 years ago

  • Status changed from New to Feedback

For CMAKE_PREFIX_PATH, this is no problem. Our intention, however, would be to include this new variable whenever a new tarball is created due to other means. We do not intend to create a new tarball for the sole purpose of adding this feature. If this is of higher priority, please raise this issue at the stakeholders' meeting.

Secondly, we can adjust the PKG_CONFIG_PATH variable, but it is not clear to us that there is any benefit, unless the product is built from source on your own machine. Have you found a way to write a relocatable .pc file?

#2 Updated by Ben Morgan about 3 years ago

Kyle Knoepfel wrote:

For CMAKE_PREFIX_PATH, this is no problem. Our intention, however, would be to include this new variable whenever a new tarball is created due to other means. We do not intend to create a new tarball for the sole purpose of adding this feature. If this is of higher priority, please raise this issue at the stakeholders' meeting.

Secondly, we can adjust the PKG_CONFIG_PATH variable, but it is not clear to us that there is any benefit, unless the product is built from source on your own machine. Have you found a way to write a relocatable .pc file?

Relocatable .pc files can be written/patched using the ${pcfiledir} variable, which expands to the runtime directory holding the .pc file (see the pkg-config man page in the "Pkg-config Derived Variables" section). CLHEP's .pc files provide a simple example of using this directly. For packages not using this variable, it should just be a case of patching the prefix variable in the output .pc file to make it derive from pcfiledir, assuming other locations are subsequently derived from prefix.

#3 Updated by Lynn Garren about 3 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Lynn Garren
  • Estimated time set to 4.00 h

#4 Updated by Kyle Knoepfel over 2 years ago

We will endeavor to make sure that this is enabled for all products included in the art 2.06.00 release.

#5 Updated by Lynn Garren over 2 years ago

  • % Done changed from 0 to 50
  • Estimated time changed from 4.00 h to 16.00 h

All products needed for art and the nu qualified build of root have been updated. This will also need to be done for the additional products used by larsoft.

#6 Updated by Lynn Garren over 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 50 to 100

This should now be in place for all relevant products.

#7 Updated by Kyle Knoepfel over 2 years ago

  • Target version set to 1209

#8 Updated by Lynn Garren over 2 years ago

  • Target version deleted (1209)

#9 Updated by Lynn Garren over 2 years ago

  • Status changed from Resolved to Closed

#10 Updated by Kyle Knoepfel over 2 years ago

  • Target version set to 2.06.03


Also available in: Atom PDF