MantisBT - CMake
View Issue Details
0007290CMakeCMakepublic2008-07-07 02:142008-10-01 13:22
Miguel Figueroa 
Bill Hoffman 
normalfeatureN/A
closedwon't fix 
CMake-2-6 
 
0007290: Patch: Add NO_CACHE option to find_xxx commands
Many times it would be helpful to have the find_xxx search capabilities and standard interface when searching for a path, file, etc., but with variables that are not meant for the cache. An example to illustrate this is:

find_path(wxWidgets_LIB_DIR
  "C:/wxWidgets"
  ...
  )
find_library(wxWidgets_core_LIBRARY
  NAMES
    wxmsw29_core
    wxmsw28_core
    wxmsw27_core
    wxmsw26_core
    wxmsw25_core
  PATHS ${wxWidgets_LIB_DIR}
  NO_DEFAULT_PATH
  NO_CACHE
  )

In this case we would like to cache wxWidgets_LIB_DIR to allow the user to be able to modify it in the gui. Then wxWidgets_core_LIBRARY should be searched for in wxWidgets_LIB_DIR without allowing or presenting the user with the opportunity to select another version of the library rooted elsewhere.

Note that we could achieve the above by using "if(EXISTS ...)", but it is much better and easier to use the same robust find_xxx interface.

I have attached a simple patch that implements this for the find_path command. I would be happy to produce a patch that implements the same functionality for the other find_xxx commands after we discuss this feature.

This feature request is somewhat related to 0007286. However, I still think the DEPENDS would be helpful even if there is a NO_CACHE like suggested here.

--Miguel
No tags attached.
patch find_xxx-no_cache.patch (4,259) 2008-07-07 02:14
https://public.kitware.com/Bug/file/1579/find_xxx-no_cache.patch
Issue History
2008-07-07 02:14Miguel FigueroaNew Issue
2008-07-07 02:14Miguel FigueroaFile Added: find_xxx-no_cache.patch
2008-08-19 16:49Bill HoffmanNote Added: 0013085
2008-08-19 16:49Bill HoffmanStatusnew => assigned
2008-08-19 16:49Bill HoffmanAssigned To => Bill Hoffman
2008-10-01 13:22Bill HoffmanStatusassigned => closed
2008-10-01 13:22Bill HoffmanNote Added: 0013653
2008-10-01 13:22Bill HoffmanResolutionopen => won't fix

Notes
(0013085)
Bill Hoffman   
2008-08-19 16:49   
It would always run each time cmake ran if it was not cached.
(0013653)
Bill Hoffman   
2008-10-01 13:22   
If we did this, cmake would do too much finding. It would be trying to find stuff every time cmake is run, even if it finds it. It should be a hard thing to do...