Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 28, 2009, 7:46:37 PM (15 years ago)
Author:
rgrieder
Message:

Merged buildsystem3 containing buildsystem2 containing Adi's buildsystem branch back to the trunk.
Please update the media directory if you were not using buildsystem3 before.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/CMakeLists.txt

    r2662 r2710  
    1 INCLUDE_DIRECTORIES(.)
    2 INCLUDE_DIRECTORIES(..)
    3 INCLUDE_DIRECTORIES(orxonox)
    4 INCLUDE_DIRECTORIES(bullet)
     1 #
     2 #             ORXONOX - the hottest 3D action shooter ever to exist
     3 #                             > www.orxonox.net <
     4 #
     5 #        This program is free software; you can redistribute it and/or
     6 #         modify it under the terms of the GNU General Public License
     7 #        as published by the Free Software Foundation; either version 2
     8 #            of the License, or (at your option) any later version.
     9 #
     10 #       This program is distributed in the hope that it will be useful,
     11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 #                 GNU General Public License for more details.
     14 #
     15 #   You should have received a copy of the GNU General Public License along
     16 #      with this program; if not, write to the Free Software Foundation,
     17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18 #
    519
     20################ Various Options ################
     21
     22# various macro includes
     23INCLUDE(FlagUtilities)
     24INCLUDE(GenerateToluaBindings)
     25INCLUDE(InstallUtilities)
     26INCLUDE(SourceFileUtilities)
     27
     28# Use TinyXML++
     29ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
     30# OIS dynamic linking requires macro definition, at least for Windows
     31ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
     32# Tolua binding speedup if required
     33ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" Release MinSizeRel TOLUA_PARSER_RELEASE)
     34
     35################ OrxonoxConfig.h ################
     36
     37# Check endianness
     38INCLUDE(TestBigEndian)
     39TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
     40IF(NOT ORXONOX_BIG_ENDIAN)
     41  SET(ORXONOX_LITTLE_ENDIAN TRUE)
     42ENDIF()
     43
     44# 32/64 bit system check
     45IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     46  SET(ORXONOX_ARCH_64 TRUE)
     47ELSE()
     48  SET(ORXONOX_ARCH_32 TRUE)
     49ENDIF()
     50
     51# Platforms
     52SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
     53SET(ORXONOX_PLATFORM_APPLE ${APPLE})
     54SET(ORXONOX_PLATFORM_UNIX ${UNIX})
     55IF(UNIX AND NOT APPLE)
     56  SET(ORXONOX_PLATFORM_LINUX TRUE)
     57ENDIF()
     58
     59# Check __forceinline
     60INCLUDE(CheckCXXSourceCompiles)
     61SET(_source "int main() { return 0; } __forceinline void test() { return; }")
     62CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
     63
     64# Check ciso646 include (literal operators)
     65INCLUDE(CheckIncludeFileCXX)
     66CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
     67
     68# XCode and Visual Studio support multiple configurations. In order to tell the
     69# which one we have to define the macros separately for each configuration
     70ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
     71ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
     72ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
     73ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
     74
     75SET(GENERATED_FILE_COMMENT
     76   "DO NOT EDIT THIS FILE!
     77    It has been automatically generated by CMake from OrxonoxConfig.h.in")
     78# Copy and configure OrxonoxConfig which gets included in every file
     79CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
     80# This file only gets included by very few classes to avoid a large recompilation
     81CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
     82
     83
     84############## Include Directories ##############
     85
     86# Set the search paths for include files
     87INCLUDE_DIRECTORIES(
     88  # External
     89  ${OGRE_INCLUDE_DIR}
     90  ${CEGUI_INCLUDE_DIR}
     91  ${ENET_INCLUDE_DIR}
     92  ${Boost_INCLUDE_DIRS}
     93  ${OPENAL_INCLUDE_DIRS}
     94  ${ALUT_INCLUDE_DIR}
     95  ${VORBIS_INCLUDE_DIR}
     96  ${OGG_INCLUDE_DIR}
     97  ${LUA_INCLUDE_DIR}
     98  ${TCL_INCLUDE_PATH}
     99  ${DIRECTX_INCLUDE_DIR}
     100  ${ZLIB_INCLUDE_DIR}
     101
     102  # All library includes are prefixed with the path to avoid conflicts
     103  ${CMAKE_CURRENT_SOURCE_DIR}
     104  # Bullet headers really need the include directory
     105  ${CMAKE_CURRENT_SOURCE_DIR}/bullet
     106  # Convenience directory
     107  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
     108  # OrxonoxConfig.h
     109  ${CMAKE_CURRENT_BINARY_DIR}
     110  # Tolua bind files for Core
     111  ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR}
     112  # Tolua bind files for Orxonox
     113  ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR}
     114)
     115
     116
     117################ Sub Directories ################
     118
     119# Third party libraries
     120ADD_SUBDIRECTORY(tolua)
     121
     122# Include CEGUILua if not requested otherwise
     123IF(CEGUILUA_USE_INTERNAL_LIBRARY)
     124  IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
     125    MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
     126  ENDIF()
     127
     128  INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})
     129  ADD_SUBDIRECTORY(ceguilua)
     130ENDIF()
     131
     132ADD_SUBDIRECTORY(bullet)
    6133ADD_SUBDIRECTORY(cpptcl)
     134ADD_SUBDIRECTORY(ogreceguirenderer)
    7135ADD_SUBDIRECTORY(ois)
    8136ADD_SUBDIRECTORY(tinyxml)
    9 ADD_SUBDIRECTORY(bullet)
    10 ADD_SUBDIRECTORY(lua)
    11 ADD_SUBDIRECTORY(tolua)
    12137
    13 # Some people may not have CEGUILua installed, espc. with version 0.5
    14 # And we don't know what lua version it was linked against, so we compile
    15 # it ourselves.
    16 # So first, find out what CEGUI version we have.
    17 
    18 IF (WIN32)
    19     ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
    20     INCLUDE_DIRECTORIES(ceguilua-0.6.1)
    21 ELSE (WIN32)
    22     IF (${CEGUI_VERSION} LESS 0.6.0)
    23         ADD_SUBDIRECTORY(ceguilua-0.5.0b/ceguilua)
    24         INCLUDE_DIRECTORIES(ceguilua-0.5.0b)
    25     ELSE (${CEGUI_VERSION} LESS 0.6.0)
    26         ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
    27         INCLUDE_DIRECTORIES(ceguilua-0.6.1)
    28     ENDIF (${CEGUI_VERSION} LESS 0.6.0)
    29 ENDIF (WIN32)
    30 
    31 # Include macro to easily add source files in subdirectories
    32 INCLUDE(AddSourceFiles)
    33 
    34 # Our own libraries
     138# Orxonox code
    35139ADD_SUBDIRECTORY(util)
    36140ADD_SUBDIRECTORY(core)
    37 ADD_SUBDIRECTORY(audio)
     141#ADD_SUBDIRECTORY(audio)
    38142ADD_SUBDIRECTORY(network)
    39143ADD_SUBDIRECTORY(orxonox)
     144
     145# Apply version info
     146SET_TARGET_PROPERTIES(util core network orxonox
     147  PROPERTIES VERSION ${ORXONOX_VERSION})
Note: See TracChangeset for help on using the changeset viewer.