Project

General

Profile

Feature #11929

Preliminary patch to export CMAKE_PREFIX_PATH to UPS Table Files

Added by Ben Morgan about 4 years ago. Updated almost 4 years ago.

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

100%

Estimated time:
2.00 h
Spent time:
Duration:

Description

CMake uses paths in the CMAKE_PREFIX_PATH (path/list) variable as the first place it searches for packages in the various find_XXX commands. The variable can be supplied on the command line (which overrides further setting) or in the environment. See:

https://cmake.org/cmake/help/v3.3/command/find_package.html
https://cmake.org/cmake/help/v3.3/variable/CMAKE_PREFIX_PATH.html

UPS/Cetbuildtools currently cannot use this feature as the UPS table files do not prepend to the CMAKE_PREFIX_PATH variable as appropriate for the parent product. Using CMAKE_PREFIX_PATH could simplify configuration and improve portability by allowing the find_ups_product wrapper to be removed whilst allowing the same robustness and guarantees of product location (but see the TODO below!)

The patch adds a rule in the build_table program to add an entry for prepending CMAKE_PREFIX_PATH in the generated table file. Using the rules
for installing CMake config files in Modules/CetCMakeConfig.cmake, set the path to be prepended as:

- "product dir" for a null flavoured product
- "fq product dir" for a flavoured product

This should be appropriate as cetbuildtools does not allow the installation directory for cmake files of products to be set by the user in the product_deps file.

Whilst it creates the correct entries in the table, it requires testing to ensure the environment variable is set appropriately for various product hierarchies.

The main todo is to explore the use of the various NO_XXX local and global settings described in the CMake documents listed above. These should allow robust location without fallback to system or other paths, and could be set in CetCMakeEnv or providing relevant policies for use of find_package.

History

#1 Updated by Lynn Garren about 4 years ago

  • Status changed from New to Accepted

This sounds reasonable. We will review and apply.

#2 Updated by Lynn Garren about 4 years ago

  • Status changed from Accepted to Assigned
  • Assignee set to Lynn Garren

#3 Updated by Lynn Garren about 4 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
  • Estimated time set to 2.00 h

Table files generated by cetbuildtools v1_19_01 or greater will also define CMAKE_PREFIX_PATH. The defined path seems quite reasonable.

#4 Updated by Lynn Garren almost 4 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF