Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2233


Ignore:
Timestamp:
Nov 19, 2008, 8:39:40 PM (16 years ago)
Author:
rgrieder
Message:

Added 'w' argument for tolua. That specifies the working directory when including files in the package.
If 'w' is not specified, the path of the package file is used. And if even that is not given, the application working directory is used.

Location:
code/branches/buildsystem
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem/cmake/UseTolua.cmake

    r1978 r2233  
    4444  ADD_CUSTOM_COMMAND(
    4545    OUTPUT "${_tolua_cxxfile}" "${_tolua_hfile}"
    46     COMMAND "${TOLUA_EXECUTABLE}" -n "${_tolua_package}" -o "${_tolua_cxxfile}" -H "${_tolua_hfile}" "${_tolua_pkgfile}"
     46    COMMAND "${TOLUA_EXECUTABLE}" -n "${_tolua_package}" -w ${CMAKE_CURRENT_SOURCE_DIR} -o "${_tolua_cxxfile}" -H "${_tolua_hfile}" "${_tolua_pkgfile}"
    4747    DEPENDS "${_tolua_executable_name}" ${_tolua_inputfiles}
    4848    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
  • code/branches/buildsystem/src/tolua/CMakeLists.txt

    r1975 r2233  
    2424ADD_CUSTOM_COMMAND(
    2525  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/toluabind_orxonox.c
    26   COMMAND ${TOLUAGEN_EXE} -n tolua -o ${CMAKE_CURRENT_BINARY_DIR}/toluabind_orxonox.c -H ${CMAKE_CURRENT_BINARY_DIR}/toluabind_orxonox.h ${TOLUA_PACKAGE}
     26  COMMAND ${TOLUAGEN_EXE} -n tolua -w ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/toluabind_orxonox.c -H ${CMAKE_CURRENT_BINARY_DIR}/toluabind_orxonox.h ${TOLUA_PACKAGE}
    2727  DEPENDS
    2828    toluagen_orxonox
  • code/branches/buildsystem/src/tolua/lua/package.lua

    r2229 r2233  
    277277    end
    278278
     279    -- prepare working directory
     280    local current_path
     281    if not flags.w and flags.f then
     282        current_path = gsub(flags.f, '(/)[^/]*%.?[^/]*$', '%1')
     283    elseif flags.w then
     284        if not (string.sub(flags.w, string.len(flags.w)) == '/') then
     285            current_path = flags.w..'/'
     286        else
     287            current_path = flags.w
     288        end
     289    else
     290        current_path = ''
     291    end
     292
    279293    -- deal with include directive
    280294    local nsubst
     
    283297            function (kind,fn,extra)
    284298                local _, _, ext = strfind(fn,".*%.(.*)$")
    285                 local fp,msg = openfile(fn,'r')
     299                local fp,msg = openfile(current_path..fn,'r')
    286300                if not fp then
    287301                    error('#'..msg..': '..fn)
  • code/branches/buildsystem/src/tolua/tolua.c

    r1975 r2233  
    3434         "  -H  file : create include file.\n"
    3535         "  -n  name : set package name; default is input file root name.\n"
     36         "  -w  folder : set working directory; efault is location of package file.\n"
    3637         "  -p       : parse only.\n"
    3738         "  -P       : parse and print structure information (for debug).\n"
     
    125126     case 'n': setfield(L,t,"n",argv[++i]); break;
    126127     case 'H': setfield(L,t,"H",argv[++i]); break;
     128     case 'w': setfield(L,t,"w",argv[++i]); break;
    127129     case 'S': setfield(L,t,"S",""); break;
    128130     case '1': setfield(L,t,"1",""); break;
Note: See TracChangeset for help on using the changeset viewer.