diff options
author | Brad King <brad.king@kitware.com> | 2008-06-09 20:04:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-06-09 20:04:06 (GMT) |
commit | e2ec3b671b3753da42df167ba1a4e496d08b5ce2 (patch) | |
tree | fe2cea51ff2d1d1e681483a4bdad911fea88457c /Modules/CMakeFindBinUtils.cmake | |
parent | 05434489079708e9896d03b7fc9153ded1d960b4 (diff) | |
download | CMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.zip CMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.tar.gz CMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.tar.bz2 |
ENH: Cleanup Find* modules with new HINTS feature
- The find_* commands now provide a HINTS option.
- The option specifies paths to be preferred over the system paths.
- Many Find* modules were using two find calls with NO_DEFAULT_PATH
to approximate the behavior, but that blocked users from overriding
things with CMAKE_PREFIX_PATH.
- This commit uses the HINTS feature to get desired behavior in
only one find command call.
Diffstat (limited to 'Modules/CMakeFindBinUtils.cmake')
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 9d76e75..dc64673 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -22,8 +22,7 @@ IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") - FIND_PROGRAM(CMAKE_LINKER NAMES link PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_LINKER NAMES link) + FIND_PROGRAM(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) MARK_AS_ADVANCED(CMAKE_LINKER) @@ -32,29 +31,18 @@ ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") - FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar) + FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) - FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib) + FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) IF(NOT CMAKE_RANLIB) SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") ENDIF(NOT CMAKE_RANLIB) - FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip) - - FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld) - - FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm) - - FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump) - - FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy) + FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY) @@ -65,8 +53,7 @@ ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" # on Apple there really should be install_name_tool IF(APPLE) - FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) - FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool) + FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) IF(NOT CMAKE_INSTALL_NAME_TOOL) MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.") |