Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2239


Ignore:
Timestamp:
Nov 20, 2008, 10:13:11 PM (16 years ago)
Author:
rgrieder
Message:

Resolved tolua include directory problem in another fashion by adding CMAKE_BINARY_DIR/src to the include directories and adjusting the the include directives. There were some changes necessary in package.lua (it uses the package name as folder to write "#include "core/CommandExecutor.h"").

The problem with the old resolution (-iquotes) was that you could write "#include "Core.h"" in a file that is not in the core, because src/core was effectively added to the list of include directories (just the ones with quotes of course).

Location:
code/branches/buildsystem
Files:
7 edited

Legend:

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

    r2236 r2239  
    1919GET_TARGET_PROPERTY(TOLUA_EXECUTABLE "${_tolua_executable_name}" LOCATION)
    2020
    21 MACRO(INCLUDE_DIRECTORIES_QUOTES)
    22   FOREACH(_tolua_quote_dir ${ARGN})
    23     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -iquote ${_tolua_quote_dir}")
    24     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -iquote ${_tolua_quote_dir}")
    25   ENDFOREACH(_tolua_quote_dir)
    26 ENDMACRO(INCLUDE_DIRECTORIES_QUOTES)
    27 
    2821MACRO(TOLUA _tolua_package _tolua_srcfiles_varname)
    2922  # TODO: cleaner arguments handling
     
    3225
    3326  SET(_tolua_pkgfile "${CMAKE_CURRENT_BINARY_DIR}/tolua.pkg")
    34   SET(_tolua_cxxfile "${CMAKE_CURRENT_BINARY_DIR}/tolua_bind.cc")
    35   SET(_tolua_hfile   "${CMAKE_CURRENT_BINARY_DIR}/tolua_bind.h")
     27  SET(_tolua_cxxfile "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.cc")
     28  SET(_tolua_hfile   "${CMAKE_CURRENT_BINARY_DIR}/ToluaBind${_tolua_package}.h")
    3629  SET(${_tolua_srcfiles_varname} ${${_tolua_srcfiles_varname}} "${_tolua_cxxfile}")
    3730
  • code/branches/buildsystem/src/CMakeLists.txt

    r2237 r2239  
    2121  orxonox
    2222  tolua
     23  # Required for tolua bind files that are in the build folder
     24  ${CMAKE_CURRENT_BINARY_DIR}
    2325)
    2426
  • code/branches/buildsystem/src/core/CMakeLists.txt

    r2198 r2239  
    5454INCLUDE(UseTolua)
    5555TOLUA(Core CORE_SRC_FILES INPUTFILES Script.h CommandExecutor.h)
    56 INCLUDE_DIRECTORIES_QUOTES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
    5756
    5857ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
  • code/branches/buildsystem/src/core/Script.cc

    r1975 r2239  
    4040
    4141#include "tolua++.h"
    42 #include "tolua_bind.h"
     42#include "core/ToluaBindCore.h"
    4343
    4444namespace orxonox
  • code/branches/buildsystem/src/orxonox/CMakeLists.txt

    r2198 r2239  
    6666INCLUDE(UseTolua)
    6767TOLUA(Orxonox ORXONOX_SRC_FILES INPUTFILES gui/GUIManager.h)
    68 INCLUDE_DIRECTORIES_QUOTES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
    69 INCLUDE_DIRECTORIES_QUOTES("${CMAKE_SOURCE_DIR}/src/core" "${CMAKE_BINARY_DIR}/src/core")
    7068
    7169ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
  • code/branches/buildsystem/src/orxonox/gui/GUIManager.cc

    r1975 r2239  
    4343#include "core/input/InputManager.h"
    4444#include "core/input/SimpleInputState.h"
    45 #include "../core/tolua_bind.h"
    4645#include "core/ConsoleCommand.h"
    4746#include "core/Core.h"
    48 #include "tolua_bind.h"
     47#include "core/ToluaBindCore.h"
     48#include "orxonox/ToluaBindOrxonox.h"
    4949#include "GraphicsEngine.h"
    5050#include "OgreCEGUIRenderer.h"
  • code/branches/buildsystem/src/tolua/lua/package.lua

    r2236 r2239  
    128128    if flags.H then
    129129        local header = gsub(flags.H, '^.-([%w_]*%.[%w_]*)$', '%1')
    130         output('#include "'..header..'"\n')
     130        local package_lower = string.lower(self.name)
     131        output('#include "'..package_lower..'/'..header..'"\n')
    131132    end
    132133
     
    203204
    204205    if flags.H then
    205         output('#include "'..self.name..'Prereqs.h"\n')
     206        local package_lower = string.lower(self.name)
     207        output('#include "'..package_lower..'/'..self.name..'Prereqs.h"\n')
    206208        output('/* Exported function */')
    207209        output('_'..self.name..'Export')
     
    220222-- *** Thanks to Ariel Manzur for fixing bugs in nested directives ***
    221223function extract_code(fn,s)
    222     local code = '\n$#include "'..fn..'"\n'
     224    local code = '\n$#include "'..string.lower(flags.n)..'/'..fn..'"\n'
    223225    s= "\n" .. s .. "\n" -- add blank lines as sentinels
    224226
Note: See TracChangeset for help on using the changeset viewer.