summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2011-03-27 13:05:15 +0200
committerPeter Drahoš <drahosp@gmail.com>2011-03-27 13:05:15 +0200
commit8c988984c0633437730dde7edd930f6f8b854179 (patch)
tree26c84b44f3ef6b0ea3e18353457e98eb8b82dccb
parent33adf9e35813dc28c969b5f482f8bce86bcddf42 (diff)
downloadlua-8c988984c0633437730dde7edd930f6f8b854179.tar.gz
Autoconfig of LUA_ROOT. No longer needed to be passed manually.
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6db4251..8244f11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,13 +22,20 @@ set ( LUA_PROMPT2 ">> " CACHE STRING "Is the default continuation prompt used by
set ( LUA_MAXINPUT 512 CACHE NUMBER "Is the maximum length for an input line in the stand-alone interpreter.")
#2DO: LUAI_* and LUAL_* settings, for now defaults are used.
-
+
set ( LUA_DIRSEP "/" )
set ( LUA_MODULE_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX} )
-set ( LUA_ROOT ${CMAKE_INSTALL_PREFIX} CACHE STRING "Destination from which modules will be resolved. See INSTALL_LMOD and INSTALL_CMOD.")
set ( LUA_LDIR ${INSTALL_LMOD} )
set ( LUA_CDIR ${INSTALL_CMOD} )
+if ( LUA_USE_RELATIVE_LOADLIB )
+ # This will set up relative paths to lib
+ string ( REGEX REPLACE "[^!/]+" ".." LUA_ROOT "!/${INSTALL_BIN}/" )
+else ()
+ # Direct path to installation
+ set ( LUA_ROOT ${CMAKE_INSTALL_PREFIX} CACHE STRING "Destination from which modules will be resolved. See INSTALL_LMOD and INSTALL_CMOD.")
+endif ()
+
if ( WIN32 AND NOT CYGWIN )
# Windows systems
option ( LUA_WIN "Windows specific build." ON )