Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lua-5.1-rc/cmake/FindReadline.cmake')
-rw-r--r--lua-5.1-rc/cmake/FindReadline.cmake60
1 files changed, 60 insertions, 0 deletions
diff --git a/lua-5.1-rc/cmake/FindReadline.cmake b/lua-5.1-rc/cmake/FindReadline.cmake
new file mode 100644
index 0000000..4a2fc0c
--- /dev/null
+++ b/lua-5.1-rc/cmake/FindReadline.cmake
@@ -0,0 +1,60 @@
+# - Find the readline library
+# This module defines
+# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
+# READLINE_LIBRARIES, the libraries required to use READLINE.
+# READLINE_FOUND, If false, do not try to use READLINE.
+# also defined, but not for general use are
+# READLINE_readline_LIBRARY, where to find the READLINE library.
+
+# Apple readline does not support readline hooks
+# So we look for another one by default
+IF(APPLE)
+ FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS
+ /sw/include
+ /opt/local/include
+ /opt/include
+ /usr/local/include
+ /usr/include/
+ NO_DEFAULT_PATH
+ )
+ENDIF(APPLE)
+FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h)
+
+
+# Apple readline does not support readline hooks
+# So we look for another one by default
+IF(APPLE)
+ FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline PATHS
+ /sw/lib
+ /opt/local/lib
+ /opt/lib
+ /usr/local/lib
+ /usr/lib
+ NO_DEFAULT_PATH
+ )
+ENDIF(APPLE)
+FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline)
+
+MARK_AS_ADVANCED(
+ READLINE_INCLUDE_DIR
+ READLINE_readline_LIBRARY
+ )
+
+SET( READLINE_FOUND "NO" )
+IF(READLINE_INCLUDE_DIR)
+ IF(READLINE_readline_LIBRARY)
+ SET( READLINE_FOUND "YES" )
+ SET( READLINE_LIBRARIES
+ ${READLINE_readline_LIBRARY}
+ )
+
+ ENDIF(READLINE_readline_LIBRARY)
+ENDIF(READLINE_INCLUDE_DIR)
+
+IF(READLINE_FOUND)
+ MESSAGE(STATUS "Found readline library")
+ELSE(READLINE_FOUND)
+ IF(READLINE_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find readline -- please give some paths to CMake")
+ ENDIF(READLINE_FIND_REQUIRED)
+ENDIF(READLINE_FOUND)