Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1115 for code/trunk/src


Ignore:
Timestamp:
Apr 20, 2008, 2:54:15 AM (17 years ago)
Author:
landauf
Message:

tried to integrate the whole tolua-thing in proper cmake code

Location:
code/trunk/src
Files:
1 deleted
5 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • code/trunk/src/CMakeLists.txt

    r1076 r1115  
    11INCLUDE_DIRECTORIES(.)
    22INCLUDE_DIRECTORIES(orxonox)
    3 INCLUDE_DIRECTORIES(util/tolua)
     3INCLUDE_DIRECTORIES(tolua)
    44
     5ADD_SUBDIRECTORY(tolua)
    56ADD_SUBDIRECTORY(util)
    67ADD_SUBDIRECTORY(core)
  • code/trunk/src/core/CMakeLists.txt

    r1084 r1115  
    1 #get the created files
    2 AUX_SOURCE_DIRECTORY(tolua TOLUA_BIND_FILES)
    3 
    4 SET( CORE_SRC_FILES
     1SET(CORE_SRC_FILES
    52  OrxonoxClass.cc
    63  BaseObject.cc
     
    2926  Tickable.cc
    3027  Script.cc
    31   ${TOLUA_BIND_FILES}
    3228)
    3329
    34 ADD_LIBRARY( core SHARED ${CORE_SRC_FILES})
     30ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
    3531
    36 TARGET_LINK_LIBRARIES( core
     32TARGET_LINK_LIBRARIES(core
    3733  util
     34  tolualib
    3835  ${Lua_LIBRARIES}
    3936  ${Lua_LIBRARY}
  • code/trunk/src/core/Script.cc

    r1102 r1115  
    3939}
    4040
    41 #include "tolua++.h"
     41#include "tolua/tolua++.h"
    4242#include "tolua/tolua_bind.h"
    4343
  • code/trunk/src/tolua/CMakeLists.txt

    r1076 r1115  
    1 PROJECT(ToLua)
    2 
    3 #This sets where to look for modules (e.g. "Find*.cmake" files)
    4 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/)
    5 
    6 #Check whether we are on a tardis box
    7 INCLUDE(CheckTardis)
    8 
    9 ########## Compiler/Linker options ##############
    10 
    11 # if on tardis change compiler and reset boost include directory
    12 IF(IS_TARDIS)
    13   MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
    14   # force-set the compiler on tardis machines, as default points to g++-3.3
    15   SET(CMAKE_CXX_COMPILER "g++-4.1.1")
    16 ENDIF(IS_TARDIS)
    17 
    18 #set binary output directories
    19 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../../../bin)
    20 SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/../../../bin)
    21 
    22 # global compiler/linker flags. force -O2!
    23 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
    24 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
    25 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
    26 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
    27 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
    28 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
    29 
    30 #Create verbose makefile output when compiling
    31 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
    32 
    33 
    34 ############### Library finding #################
    35 
    36 #Performs the search and sets the variables
    37 FIND_PACKAGE(Lua)
    38 
    39 #Set the search paths for the linking
    40 LINK_DIRECTORIES(
    41 )
    42 
    43 #Set the search paths for include files
    44 INCLUDE_DIRECTORIES(
    45   ${Lua_INCLUDE_DIR}
    46 )
    47 
    48 
    49 ################ Source files ###################
    50 
    51 SET (TOLUA_SRC_FILES
     1SET(TOLUA_SRC_FILES
    522  tolua.c
    533  tolua_event.c
     
    599)
    6010
    61 ADD_EXECUTABLE( tolua ${TOLUA_SRC_FILES} )
    6211
    63 TARGET_LINK_LIBRARIES( tolua
     12ADD_EXECUTABLE(tolua ${TOLUA_SRC_FILES})
     13
     14TARGET_LINK_LIBRARIES(tolua
    6415  ${Lua_LIBRARIES}
    6516  ${Lua_LIBRARY}
    6617  m
    6718)
     19
     20
     21
     22SET(TOLUALIB_SRC_FILES
     23  tolua_event.c
     24  tolua_is.c
     25  tolua_map.c
     26  tolua_push.c
     27  tolua_to.c
     28  tolua_bind.cc
     29  tolua_bind.h
     30)
     31
     32SET_SOURCE_FILES_PROPERTIES(tolua_bind.h
     33  PROPERTIES
     34  OBJECT_DEPENDS tolua_bind.h
     35  OBJECT_DEPENDS tolua_bind.cc
     36  GENERATED true
     37  HEADER_FILE_ONLY true
     38)
     39
     40GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
     41ADD_CUSTOM_COMMAND(
     42  OUTPUT tolua_bind.h tolua_bind.cc
     43  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/tolua/tolua_bind.cc -H ../../src/tolua/tolua_bind.h ../../src/tolua/tolua.pkg
     44  DEPENDS tolua
     45  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
     46)
     47
     48ADD_LIBRARY(tolualib ${TOLUALIB_SRC_FILES})
     49
     50TARGET_LINK_LIBRARIES(tolualib
     51  ${Lua_LIBRARIES}
     52  ${Lua_LIBRARY}
     53)
     54
  • code/trunk/src/tolua/tolua.pkg

    r1114 r1115  
    1 $cfile "../Script_clean.h"
     1$cfile "../../src/core/Script_clean.h"
  • code/trunk/src/util/CMakeLists.txt

    r1085 r1115  
    11AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
    22
    3 SET (UTIL_SRC_FILES
     3SET(UTIL_SRC_FILES
    44  ArgReader.cc
    55  Math.cc
     
    1010  MultiTypeString.cc
    1111  MultiTypeMath.cc
    12   tolua/tolua_event.c
    13   tolua/tolua_is.c
    14   tolua/tolua_map.c
    15   tolua/tolua_push.c
    16   tolua/tolua_to.c
    1712  ${TINYXML_SRC_FILES}
    1813)
    1914
    20 ADD_LIBRARY( util SHARED ${UTIL_SRC_FILES} )
     15ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES})
    2116
    2217IF(TESTING_ENABLED)
     
    2419ENDIF(TESTING_ENABLED)
    2520
    26 TARGET_LINK_LIBRARIES( util
     21TARGET_LINK_LIBRARIES(util
    2722  ${OGRE_LIBRARIES}
    28   ${Lua_LIBRARIES}
    29   ${Lua_LIBRARY}
    3023)
    3124
Note: See TracChangeset for help on using the changeset viewer.