From c3cca4aa87ccdaaf98c245e6017c9ff78a8c8fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Draho=C5=A1?= Date: Thu, 31 Mar 2011 18:28:08 +0200 Subject: Path generation cleanup --- CMakeLists.txt | 10 +++++++--- src/luaconf.h.in | 6 +++--- 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). -- cgit v1.2.1