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/CMakeLists.txt

    r1889 r2710  
    1 PROJECT(Orxonox)
     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 #
     19 
     20CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
    221
    3 cmake_minimum_required(VERSION 2.4)
     22# Keep devs from using the root directory as binary directory (messes up the source tree)
     23IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
     24  MESSAGE(FATAL_ERROR "Please do not use the root directory as CMake output directory!
     25  mkdir build; cd build; cmake ..
     26  And you will have to clean the source directory by deleting CMakeCache.txt and the folder CMakeFiles")
     27ENDIF()
    428
    5 IF (COMMAND cmake_policy)
    6   cmake_policy(SET CMP0003 NEW)
    7 ENDIF (COMMAND cmake_policy)
    829
    9 # Allow for simple IF constructs (makes code a lot more readable)
    10 #SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
     30PROJECT(Orxonox C CXX)
     31
     32SET(ORXONOX_VERSION_MAJOR 0)
     33SET(ORXONOX_VERSION_MINOR 0)
     34SET(ORXONOX_VERSION_PATCH 3)
     35SET(ORXONOX_VERSION 0.0.3)
     36SET(ORXONOX_VERSION_NAME "Castor")
     37
    1138
    1239# This sets where to look for modules (e.g. "Find*.cmake" files)
    13 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
     40SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
    1441
    15 # Check whether we are on a tardis box
    16 INCLUDE(CheckTardis)
     42IF(UNIX AND NOT APPLE)
     43  INCLUDE(FlagUtilities)
     44  SET_CACHE(CMAKE_INSTALL_PREFIX PATH "" /usr) # default: /usr/local
     45ENDIF()
    1746
     47# Library finding
     48INCLUDE(LibraryConfig)
    1849
    19 ############## Testing options ##################
     50# General build and compiler options and configurations
     51INCLUDE(BuildConfig)
    2052
    21 OPTION(TESTING_ENABLED "Do you want to enable Testing")
    22 IF (TESTING_ENABLED)
    23   ENABLE_TESTING()
    24 ENDIF(TESTING_ENABLED)
     53# Configure media directory location and installation
     54ADD_SUBDIRECTORY(media)
    2555
    26 OPTION (NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
    27 OPTION (NETWORKTRAFFIC_TESTING_ENABLED "Do you want to build dummyserver4 and dummyclient4")
     56# Remaining tardis hack
     57ADD_SUBDIRECTORY(config)
    2858
    29 
    30 ########## Compiler/Linker options ##############
    31 
    32 # if on tardis change compiler and reset boost include directory
    33 IF(IS_TARDIS)
    34   MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
    35   # Force-set the compiler on tardis machines, as default points to g++-3.3
    36   SET(CMAKE_CXX_COMPILER "g++-4.1.1")
    37   # Reset Boost serach path
    38   SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include")
    39 ELSE (IS_TARDIS)
    40   IF (NOT WIN32)
    41     SET(Boost_INCLUDE_DIR "/usr/include/boost")
    42   ENDIF (NOT WIN32)
    43 ENDIF(IS_TARDIS)
    44 
    45 # Set binary output directories
    46 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
    47 SET(LIBRARY_OUTPUT_PATH    ${PROJECT_SOURCE_DIR}/bin/lib)
    48 
    49 # Global compiler/linker flags. force -O2!
    50 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
    51 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
    52 #SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O3 -s")
    53 #SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O3 -s")
    54 
    55 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
    56 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
    57 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
    58 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
    59 
    60 # Use 'cmake -D make_verb:1 path' to get verbose make output when compiling
    61 IF (MAKE_VERB)
    62  SET(CMAKE_VERBOSE_MAKEFILE TRUE)
    63 ENDIF (MAKE_VERB)
    64 
    65 
    66 ############### Library finding #################
    67 
    68 # Uncomment the following line if you want the include and library paths to be shown
    69 # Alternatively use the "-D VERBOSE_FIND:BOOL=true" option when executing cmake
    70 
    71 # SET (VERBOSE_FIND true)
    72 
    73 # Set the library directory when using precompiled tarballs for the dependencies under windows
    74 IF (WIN32)
    75   IF (MSVC)
    76     IF ($ENV{ORXONOX_DEV})
    77       SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/)
    78     ELSE ($ENV{ORXONOX_DEV})
    79       SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/dependencies/)
    80     ENDIF ($ENV{ORXONOX_DEV})
    81     SET(Boost_LIB_SUFFIX_DEBUG vc80-mt-gd-1_35)
    82   ENDIF (MSVC)
    83 ENDIF (WIN32)
    84 MESSAGE(STATUS ${DEPENDENCY_DIR})
    85 
    86 # Performs the search and sets the variables
    87 FIND_PACKAGE(OGRE)
    88 FIND_PACKAGE(CEGUI)
    89 # FIND_PACKAGE(CEGUI_OGRE)
    90 FIND_PACKAGE(ENet)
    91 FIND_PACKAGE(Boost REQUIRED thread filesystem)
    92 FIND_PACKAGE(OpenAL)
    93 FIND_PACKAGE(ALUT)
    94 FIND_PACKAGE(OggVorbis)
    95 FIND_PACKAGE(ZLIB)
    96 #FIND_PACKAGE(Lua)
    97 FIND_PACKAGE(TCL)
    98 FIND_PACKAGE(DirectX)
    99 
    100 # Set the search paths for the linking
    101 LINK_DIRECTORIES(
    102   ${OGRE_LIB_DIR}
    103   ${CEGUI_LIB_DIR}
    104 #  ${CEGUI_SCRIPT_LIB_DIR}
    105 #  ${CEGUI_OGRE_LIB_DIR}
    106   ${ENet_LIBRARY}
    107   ${Boost_LIBRARY_DIRS}
    108   ${Zlib_LIBRARY_DIR}
    109   ${TCL_LIBRARY}
    110 )
    111 
    112 # Set the search paths for include files
    113 INCLUDE_DIRECTORIES(
    114   ${OGRE_INCLUDE_DIR}
    115   ${CEGUI_INCLUDE_DIR}
    116 #  ${CEGUI_OGRE_INCLUDE_DIR}
    117   ${ENet_INCLUDE_DIR}
    118   ${Boost_INCLUDE_DIRS}
    119   ${OPENAL_INCLUDE_DIR}
    120   ${ALUT_INCLUDE_DIR}
    121   ${VORBIS_INCLUDE_DIR}
    122   ${OGG_INCLUDE_DIR}
    123 #  ${Lua_INCLUDE_DIR}
    124   ${TCL_INCLUDE_PATH}
    125   ${DirectX_INCLUDE_DIR}
    126   ${ZLIB_INCLUDE_DIR}
    127 )
    128 
    129 # Add main source dir
     59# Create the actual project
    13060ADD_SUBDIRECTORY(src)
    13161
     62# Configure the binary output directory. Do this after src!
     63ADD_SUBDIRECTORY(bin)
     64
     65# Last but not least: Try to make doxygen target
     66ADD_SUBDIRECTORY(doc)
Note: See TracChangeset for help on using the changeset viewer.