View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009657CMakeCMakepublic2009-10-04 12:542009-10-05 11:09
ReporterModestas Vainius 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009657: Too low preference of /usr/local in CMAKE_SYSTEM_PREFIX_PATH
DescriptionAccording to FHS [1], /usr/local "is for use by the system administrator when installing software locally". However, CMAKE_SYSTEM_PREFIX_PATH is set to

/
/usr
/usr/local

in Modules/Platform/UnixPaths.cmake:12. This way both /usr and / (software installed by system) are preferred to /usr/local (software installed by administrator). However, cmake should prefer the version installed by administrator if there is any. This is especially important for commands like FIND_PATH() which searches /include and /usr/include before /usr/local/include due to this bug. I believe the order should be:

/usr/local
/
/usr

Not sure if / and /usr should be reversed either but probably it is not that significant.

CMake 2.8-rc2 on Debian GNU/Linux. Applies to CMake 2.6 too.


1. http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY [^]
Additional InformationCMakeLists.txt
--------------
project(testproject C)
cmake_minimum_required(VERSION 2.6)
find_path(AAA_INCLUDE aaa.h)

Output
------
$ rm -f CMakeCache.txt ; strace -e trace=file -- cmake . 2>&1 | grep aaa.h

# Searches my $PATH
access("/mnt/sda2/usr/local/bin/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/sda2/usr/bin/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/bin/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/sda2/usr/games/aaa.h", R_OK) = -1 ENOENT (No such file or directory)

# Searches each <path>/include in ${CMAKE_SYSTEM_PREFIX_PATH}. Bug is evident.
access("/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/sda2/usr/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/sda2/usr/aaa.h", R_OK) = -1 ENOENT (No such file or directory)

# Searches each <path> in ${CMAKE_SYSTEM_INCLUDE_PATH}
access("/usr/include/w32api/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/X11R6/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/include/X11/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/local/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/pkg/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/csw/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/opt/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/openwin/include/aaa.h", R_OK) = -1 ENOENT (No such file or directory)
TagsNo tags attached.
Attached Files

 Relationships
related to 0010136closedBrad King CMake should prefer /usr over / 

  Notes
(0017947)
Brad King (manager)
2009-10-05 11:09

Find locally installed software first
/cvsroot/CMake/CMake/Modules/Platform/UnixPaths.cmake,v <-- Modules/Platform/UnixPaths.cmake
new revision: 1.15; previous revision: 1.14

 Issue History
Date Modified Username Field Change
2009-10-04 12:54 Modestas Vainius New Issue
2009-10-04 15:18 Bill Hoffman Status new => assigned
2009-10-04 15:18 Bill Hoffman Assigned To => Brad King
2009-10-05 11:09 Brad King Note Added: 0017947
2009-10-05 11:09 Brad King Status assigned => closed
2009-10-05 11:09 Brad King Resolution open => fixed
2010-01-13 13:17 Brad King Relationship added related to 0010136


Copyright © 2000 - 2018 MantisBT Team