summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Drahoš <drahosp@gmail.com>2011-03-31 18:28:08 +0200
committerPeter Drahoš <drahosp@gmail.com>2011-03-31 18:28:08 +0200
commitc3cca4aa87ccdaaf98c245e6017c9ff78a8c8fed (patch)
tree565518a9e78428b6a1a3d028d267b32988077ef3
parent8c988984c0633437730dde7edd930f6f8b854179 (diff)
downloadlua-c3cca4aa87ccdaaf98c245e6017c9ff78a8c8fed.tar.gz
Path generation cleanup
-rw-r--r--CMakeLists.txt10
-rw-r--r--src/luaconf.h.in6
2 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8244f11..c86f54b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,21 +30,25 @@ 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}/" )
+ string ( REGEX REPLACE "[^!/]+" ".." LUA_DIR "!/${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.")
+ set ( LUA_DIR ${CMAKE_INSTALL_PREFIX} CACHE STRING "Destination from which modules will be resolved. See INSTALL_LMOD and INSTALL_CMOD.")
endif ()
+set ( LUA_PATH_DEFAULT "./?.lua;${LUA_DIR}${LUA_LDIR}/?.lua;${LUA_DIR}${LUA_LDIR}/?/init.lua" )
+set ( LUA_CPATH_DEFAULT "./?${LUA_MODULE_SUFFIX};${LUA_DIR}${LUA_CDIR}/?${LUA_MODULE_SUFFIX};${LUA_DIR}${LUA_CDIR}/loadall${LUA_MODULE_SUFFIX}" )
+
if ( WIN32 AND NOT CYGWIN )
# Windows systems
option ( LUA_WIN "Windows specific build." ON )
option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ON )
# Paths (Double escapes needed)
set ( LUA_DIRSEP "\\\\" )
- string ( REPLACE "/" ${LUA_DIRSEP} LUA_ROOT ${LUA_ROOT} )
+ string ( REPLACE "/" ${LUA_DIRSEP} LUA_DIR ${LUA_DIR} )
string ( REPLACE "/" ${LUA_DIRSEP} LUA_LDIR ${LUA_LDIR} )
string ( REPLACE "/" ${LUA_DIRSEP} LUA_CDIR ${LUA_CDIR} )
+
else ()
# Posix systems (incl. Cygwin)
option ( LUA_USE_POSIX "Use POSIX functionality." ON )
diff --git a/src/luaconf.h.in b/src/luaconf.h.in
index 027691d..7102028 100644
--- a/src/luaconf.h.in
+++ b/src/luaconf.h.in
@@ -64,12 +64,12 @@
** path of the directory of the executable file of the current process.
*/
#cmakedefine LUA_MODULE_SUFFIX "@LUA_MODULE_SUFFIX@"
-#cmakedefine LUA_ROOT "@LUA_ROOT@"
+#cmakedefine LUA_DIR "@LUA_DIR@"
#cmakedefine LUA_LDIR "@LUA_LDIR@"
#cmakedefine LUA_CDIR "@LUA_CDIR@"
-#define LUA_PATH_DEFAULT "./?.lua;" LUA_ROOT "/" LUA_LDIR "/?.lua;" LUA_ROOT "/" LUA_LDIR "/?/init.lua"
-#define LUA_CPATH_DEFAULT "./?" LUA_MODULE_SUFFIX ";" LUA_ROOT "/" LUA_CDIR "/?" LUA_MODULE_SUFFIX ";" LUA_ROOT "/" LUA_CDIR "/loadall" LUA_MODULE_SUFFIX
+#define LUA_PATH_DEFAULT "@LUA_PATH_DEFAULT@"
+#define LUA_CPATH_DEFAULT "@LUA_CPATH_DEFAULT@"
/*
@@ LUA_DIRSEP is the directory separator (for submodules).