MantisBT - CMake
View Issue Details
0009567CMakeCMakepublic2009-09-18 14:122009-09-21 13:32
dataangel 
Brad King 
normalminorhave not tried
closedno change required 
 
 
0009567: There should be a DEFAULT_PACKAGE_ROOTS for all find_package .cmake files to use
There are lots of FindFoo.cmake files that contain a FOO_ROOT variable to specify where the root folder to look for lib/include/etc. is. And usually they have a list of paths to check, and across all of the FindXXXX.cmake files they should pretty much be the same:

-Look in Program Files on windows
-Look in /opt/local on OS X
-Look in /usr on *nix

These should be provided by a predefined DEFAULT_PACKAGE_ROOTS variable that would contain a list of all the common places for the OS you're building on, so that this stops getting duplicated over and over. I just reported this bug for FindBoost.cmake:

http://www.cmake.org/Bug/view.php?id=9566 [^]

But I bet it applies to many other packages.
No tags attached.
Issue History
2009-09-18 14:12dataangelNew Issue
2009-09-21 13:13Bill HoffmanStatusnew => assigned
2009-09-21 13:13Bill HoffmanAssigned To => Brad King
2009-09-21 13:32Brad KingNote Added: 0017679
2009-09-21 13:32Brad KingStatusassigned => closed
2009-09-21 13:32Brad KingResolutionopen => no change required

Notes
(0017679)
Brad King   
2009-09-21 13:32   
This already exists. It's called "CMAKE_SYSTEM_PREFIX_PATH":

http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_SYSTEM_PREFIX_PATH [^]

It already takes care of listing 32-bit and 64-bit Program Files directories, etc.

Furthermore, all the FIND_* commands already search under it.

If a module needs specific package names to be added, it is free to do so. For example, FindBoost could do:

  set(_boost_INCLUDE_SEARCH_DIRS)
  foreach(dir ${CMAKE_SYSTEM_PREFIX_PATH})
    list(APPEND _boost_INCLUDE_SEARCH_DIRS ${dir}/boost/include ${dir}/boost)
  endforeach()

instead of hard-coding the include search path.