From 8c988984c0633437730dde7edd930f6f8b854179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Draho=C5=A1?= Date: Sun, 27 Mar 2011 13:05:15 +0200 Subject: Autoconfig of LUA_ROOT. No longer needed to be passed manually. --- CMakeLists.txt | 11 +++++++++-- 1 file 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 ) -- cgit v1.2.1