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/FindLua50.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/FindLua50.cmake')
-rw-r--r-- | Modules/FindLua50.cmake | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake index dce4837..a5e8c51 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -13,13 +13,9 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h - PATHS + HINTS $ENV{LUA_DIR} - NO_DEFAULT_PATH PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include -) - -FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ~/Library/Frameworks /Library/Frameworks @@ -29,19 +25,13 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h /opt/local # DarwinPorts /opt/csw # Blastwave /opt - PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include ) FIND_LIBRARY(LUA_LIBRARY_lua NAMES lua50 lua5.0 lua5 lua - PATHS + HINTS $ENV{LUA_DIR} - NO_DEFAULT_PATH - PATH_SUFFIXES lib64 lib -) - -FIND_LIBRARY(LUA_LIBRARY_lua - NAMES lua50 lua5.0 lua5 lua + PATH_SUFFIXES lib64 lib PATHS ~/Library/Frameworks /Library/Frameworks @@ -51,7 +41,6 @@ FIND_LIBRARY(LUA_LIBRARY_lua /opt/local /opt/csw /opt - PATH_SUFFIXES lib64 lib ) # In an OS X framework, lualib is usually included as part of the framework @@ -61,15 +50,10 @@ IF(${LUA_LIBRARY_lua} MATCHES "framework") ELSE(${LUA_LIBRARY_lua} MATCHES "framework") FIND_LIBRARY(LUA_LIBRARY_lualib NAMES lualib50 lualib5.0 lualib5 lualib - PATHS + HINTS $ENV{LUALIB_DIR} $ENV{LUA_DIR} - NO_DEFAULT_PATH PATH_SUFFIXES lib64 lib - ) - - FIND_LIBRARY(LUA_LIBRARY_lualib - NAMES lualib50 lualib5.0 lualib5 lualib PATHS /usr/local /usr @@ -77,7 +61,6 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework") /opt/local /opt/csw /opt - PATH_SUFFIXES lib64 lib ) IF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua) # include the math library for Unix |