[cmake-developers] Proposed Feature: Selective search path re-rooting
Chuck Atkins
chuck.atkins at kitware.com
Mon Oct 13 11:40:10 EDT 2014
Following the topic branch to separately maintain each type of search path,
I'm working on adding a feature for cross-compiling to separately control
how each type of search path gets re-rooted. Currently, the options
CMAKE_FIND_ROOT_PATH_MODE_{INCLUDE_LIBRARY_PROGRAM} can be set to ONLY,
NEVER, or BOTH. This takes effect for all search paths, both CMake
determined and user-specifies (through HINTS and PATHS options). Before
putting the time and effort into implementing the feature this way, I
wanted to get some feedback on the design first:
My approach to control the path types independently is to allow the
variable to be specified as either a single mode, applying to all paths, or
a named list of the form "PATH_TYPE1 MODE1 PATH_TYPE2_MODE2..." much in the
way that properties are specified. The following search path groups can be
specified:
- CMAKE_PATH
- CMAKE_ENVIRONMENT_PATH
- USER_HINTS_PATH
- SYSTEM_ENVIRONMENT_PATH
- CMAKE_SYSTEM_PATH
- USER_GUESS_PATH
In addition to each search path type, there will also be defined path
groups:
- ALL - All search paths
- DEFAULT
- CMAKE_PATH
- CMAKE_ENVIRONMENT_PATH
- SYSTEM_ENVIRONMENT_PATH
- CMAKE_SYSTEM_PATH
- USER - User hints and user guess paths
If one had:
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ALL ONLY HINTS NEVER)
Then the following modes would be set:
- find_program: All search paths set to never
- find_library: user hints would never be re-rooted and all others would
operate in ONLY mode.
- find_file: All search paths set to BOTH mode since that's the default
behavior.
- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141013/f29370a1/attachment-0002.html>
More information about the cmake-developers
mailing list