Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2197


Ignore:
Timestamp:
Nov 12, 2008, 4:08:35 PM (16 years ago)
Author:
adrfried
Message:

FindCEGUI.cmake and others cleaned up

Location:
code/branches/buildsystem
Files:
1 added
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem/CMakeLists.txt

    r1999 r2197  
    33CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
    44
    5 IF (COMMAND cmake_policy)
    6   cmake_policy(SET CMP0003 NEW)
    7 ENDIF (COMMAND cmake_policy)
    8 
    9 # Allow for simple IF constructs (makes code a lot more readable)
    10 #SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
     5# TODO: Test CMake Modules without policy
     6#IF (COMMAND cmake_policy)
     7#  cmake_policy(SET CMP0003 NEW)
     8#ENDIF (COMMAND cmake_policy)
    119
    1210# This sets where to look for modules (e.g. "Find*.cmake" files)
    1311SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
    1412
    15 # Check whether we are on a tardis box and set customized paths
     13# Check for special include paths
    1614INCLUDE(CheckTardis)
     15INCLUDE(CheckOrxonoxWinDeps)
    1716
    18 ############## Testing options ##################
     17################ Test options ###################
    1918
    20 #OPTION(TESTING_ENABLED "Do you want to enable Testing")
    21 #IF (TESTING_ENABLED)
    22 #  ENABLE_TESTING()
    23 #ENDIF(TESTING_ENABLED)
    24 #
    25 #OPTION (NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike")
    26 #OPTION (NETWORKTRAFFIC_TESTING_ENABLED "Do you want to build dummyserver4 and dummyclient4")
     19OPTION(ENABLE_TESTS "Enable build tests.")
     20IF(ENABLE_TESTS)
     21  ENABLE_TESTING()
     22ENDIF(ENABLE_TESTS)
     23
     24OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
     25OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
    2726
    2827########## Compiler/Linker options ##############
     
    3130SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
    3231SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/bin)
     32MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
    3333
     34# TODO: use CMake's options for build types
    3435# Global compiler/linker flags.
    3536SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -Wall -Wextra -Wno-unused-parameter -g -ggdb")
     
    4546############### Library finding #################
    4647
    47 # Uncomment the following line if you want the include and library paths to be shown
    48 # Alternatively use the "-D VERBOSE_FIND:BOOL=true" option when executing cmake
    49 
    50 # SET (VERBOSE_FIND true)
    51 
    52 # Set the library directory when using precompiled tarballs for the dependencies under windows
    53 IF (WIN32)
    54   IF (MSVC)
    55     IF ($ENV{ORXONOX_DEV})
    56       SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/../lib_dist/dependencies/)
    57     ELSE ($ENV{ORXONOX_DEV})
    58       SET (DEPENDENCY_DIR ${CMAKE_SOURCE_DIR}/dependencies/)
    59     ENDIF ($ENV{ORXONOX_DEV})
    60     SET(Boost_LIB_SUFFIX_DEBUG vc80-mt-gd-1_35)
    61     #MESSAGE(STATUS ${DEPENDENCY_DIR})
    62   ENDIF (MSVC)
    63 ENDIF (WIN32)
    64 
    6548# Performs the search and sets the variables
    6649FIND_PACKAGE(OGRE REQUIRED)
     
    7457FIND_PACKAGE(OggVorbis REQUIRED)
    7558FIND_PACKAGE(ZLIB REQUIRED)
     59#TODO: don't require the whole tcl stuff
    7660FIND_PACKAGE(TCL REQUIRED)
    7761FIND_PACKAGE(DirectX REQUIRED)
  • code/branches/buildsystem/cmake/CheckTardis.cmake

    r2061 r2197  
    4545  SET(ENV{OGGVORBISDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    4646  #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
     47  SET(ENV{CEGUIDIR} "/usr/pack/cegui-0.5.0-sd;/usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1")
    4748ENDIF (IS_TARDIS)
     49
     50MARK_AS_ADVANCED(UNAME_CMD IS_TARDIS)
  • code/branches/buildsystem/cmake/FindCEGUI.cmake

    r1872 r2197  
    33# This module defines
    44#  CEGUI_INCLUDE_DIR
    5 #  CEGUI_LIBRARIES, the libraries to link against to use CEGUI.
    6 #  CEGUI_LIB_DIR, the location of the libraries
     5#  CEGUI_LIBRARY, the library to link against to use CEGUI.
    76#  CEGUI_FOUND, If false, do not try to use CEGUI
    87#
     
    1716#
    1817# Several changes and additions by Fabian 'x3n' Landau
     18# Lots of simplifications by Adrian Friedli
    1919#                 > www.orxonox.net <
    2020
    21 IF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
    22     SET(CEGUI_FIND_QUIETLY TRUE) # Already in cache, be silent
    23 ENDIF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
     21# TODO: Determine CEGUI version
    2422
    25 IF (WIN32) #Windows
    26     FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    27         ../libs/cegui-0.6.1/include
    28         ${DEPENDENCY_DIR}/cegui-0.6.1/include
    29     )
     23FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
     24    PATHS
     25    $ENV{CEGUIDIR}
     26    /usr/local
     27    /usr
     28    PATH_SUFFIXES include include/CEGUI
     29)
    3030
    31     SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
    32     FIND_LIBRARY(CEGUI_LIBDIR NAMES ${CEGUI_LIBRARIES} PATHS
    33         ../libs/cegui-0.6.1/bin
    34         ${DEPENDENCY_DIR}/cegui-0.6.1/lib
    35     )
    36 
    37     # Strip the filename from the path
    38     IF (CEGUI_LIBDIR)
    39         GET_FILENAME_COMPONENT(CEGUI_LIBDIR ${CEGUI_LIBDIR} PATH)
    40         SET (CEGUI_LIB_DIR ${CEGUI_LIBDIR} CACHE FILEPATH "")
    41     ENDIF (CEGUI_LIBDIR)
     31#SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
     32FIND_LIBRARY(CEGUI_LIBRARY
     33    NAMES CEGUIBase
     34    PATHS
     35    $ENV{CEGUIDIR}
     36    /usr/local
     37    /usr
     38    PATH_SUFFIXES lib
     39)
    4240
    4341#    IF (NOT CEGUI_SCRIPT_LIBDIR)
     
    5856#    ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
    5957
    60 #    # Strip the filename from the path
    61 #    IF (CEGUI_SCRIPT_LIBDIR)
    62 #        GET_FILENAME_COMPONENT(CEGUI_SCRIPT_LIBDIR ${CEGUI_SCRIPT_LIBDIR} PATH)
    63 #        SET (CEGUI_SCRIPT_LIB_DIR ${CEGUI_SCRIPT_LIBDIR} CACHE FILEPATH "")
    64 #    ENDIF (CEGUI_SCRIPT_LIBDIR)
     58INCLUDE(FindPackageHandleStandardArgs)
     59FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUI DEFAULT_MSG
     60    CEGUI_LIBRARY
     61    CEGUI_INCLUDE_DIR
     62    #CEGUI_SCRIPT_LIBRARIES
     63)
    6564
    66 ELSE (WIN32) #Unix
    67     FIND_PACKAGE(PkgConfig)
    68     PKG_SEARCH_MODULE(CEGUI CEGUI /usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI.pc) # tardis specific hack
    69     SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})
    70     SET(CEGUI_LIB_DIR ${CEGUI_LIBDIR})
    71     SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
    72 #    SET(CEGUI_SCRIPT_LIBRARIES "CEGUILuaScriptModule")
    73 #    SET(CEGUI_SCRIPT_LIB_DIR)
    74 ENDIF (WIN32)
    75 
    76 IF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
    77     SET(CEGUI_FOUND TRUE)
    78 
    79     #Do some preparation
    80     SEPARATE_ARGUMENTS(CEGUI_INCLUDE_DIR)
    81     SEPARATE_ARGUMENTS(CEGUI_LIBRARIES)
    82 
    83     SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIR} CACHE PATH "")
    84     SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
    85     SET(CEGUI_LIB_DIR ${CEGUI_LIB_DIR} CACHE PATH "")
    86 #    SET(CEGUI_SCRIPT_LIBRARIES ${CEGUI_SCRIPT_LIBRARIES} CACHE PATH "")
    87 ENDIF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
    88 
    89 IF (CEGUI_FOUND)
    90     IF (NOT CEGUI_FIND_QUIETLY)
    91         MESSAGE(STATUS "CEGUI was found.")
    92         IF (VERBOSE_FIND)
    93             MESSAGE (STATUS "  include path: ${CEGUI_INCLUDE_DIR}")
    94             MESSAGE (STATUS "  library path: ${CEGUI_LIB_DIR}")
    95             MESSAGE (STATUS "  libraries:    ${CEGUI_LIBRARIES}")
    96 #            MESSAGE (STATUS "           :    ${CEGUI_SCRIPT_LIBRARIES}")
    97         ENDIF (VERBOSE_FIND)
    98     ENDIF (NOT CEGUI_FIND_QUIETLY)
    99 ELSE (CEGUI_FOUND)
    100     IF (NOT CEGUI_INCLUDE_DIR)
    101         MESSAGE(SEND_ERROR "CEGUI include path was not found.")
    102     ENDIF (NOT CEGUI_INCLUDE_DIR)
    103     IF (NOT CEGUI_LIB_DIR)
    104         MESSAGE(SEND_ERROR "CEGUI library was not found.")
    105     ENDIF (NOT CEGUI_LIB_DIR)
    106     IF (NOT CEGUI_LIBRARIES)
    107         MESSAGE(SEND_ERROR "CEGUI libraries not known.")
    108     ENDIF (NOT CEGUI_LIBRARIES)
    109 #    IF (NOT CEGUI_SCRIPT_LIBRARIES)
    110 #        MESSAGE(SEND_ERROR "CEGUI Lua script module was not found.")
    111 #    ENDIF (NOT CEGUI_SCRIPT_LIBRARIES)
    112 ENDIF (CEGUI_FOUND)
    113 
     65MARK_AS_ADVANCED(
     66    CEGUI_LIBRARY
     67    CEGUI_INCLUDE_DIR
     68    #CEGUI_SCRIPT_LIBRARIES
     69)
  • code/branches/buildsystem/src/CMakeLists.txt

    r2135 r2197  
    1616)
    1717
     18# TODO: remove this after the CMake Modules have been fixed and use absolut paths
    1819# Set the search paths for the linking
    19 # TODO: remove this after the CMake Modules have been fixed and use absolut paths
    2020LINK_DIRECTORIES(
    2121  ${OGRE_LIB_DIR}
    22   ${CEGUI_LIB_DIR}
    2322)
    2423
     
    3332ADD_SUBDIRECTORY(ois)
    3433ADD_SUBDIRECTORY(tinyxml)
    35 #ADD_SUBDIRECTORY(lua)
    3634ADD_SUBDIRECTORY(tolua)
    3735
     
    4644    INCLUDE_DIRECTORIES(ceguilua-0.6.1)
    4745ELSE (WIN32)
    48     IF (${CEGUI_VERSION} LESS 0.6.0)
     46    # FIXME
     47    #IF (${CEGUI_VERSION} LESS 0.6.0)
    4948        ADD_SUBDIRECTORY(ceguilua-0.5.0/ceguilua)
    5049        INCLUDE_DIRECTORIES(ceguilua-0.5.0)
    51     ELSE (${CEGUI_VERSION} LESS 0.6.0)
    52         ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
    53         INCLUDE_DIRECTORIES(ceguilua-0.6.1)
    54     ENDIF (${CEGUI_VERSION} LESS 0.6.0)
     50    #ELSE (${CEGUI_VERSION} LESS 0.6.0)
     51    #    ADD_SUBDIRECTORY(ceguilua-0.6.1/ceguilua)
     52    #    INCLUDE_DIRECTORIES(ceguilua-0.6.1)
     53    #ENDIF (${CEGUI_VERSION} LESS 0.6.0)
    5554ENDIF (WIN32)
    5655
  • code/branches/buildsystem/src/ceguilua-0.5.0/ceguilua/CMakeLists.txt

    r1980 r2197  
    1111  tolualib_orxonox
    1212  ${LUA_LIBRARIES}
    13   ${CEGUI_LIBRARIES}
     13  ${CEGUI_LIBRARY}
    1414)
  • code/branches/buildsystem/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt

    r1979 r2197  
    1111  tolualib_orxonox
    1212  ${LUA_LIBRARIES}
    13   ${CEGUI_LIBRARIES}
     13  ${CEGUI_LIBRARY}
    1414)
  • code/branches/buildsystem/src/orxonox/CMakeLists.txt

    r1979 r2197  
    9292TARGET_LINK_LIBRARIES( orxonox
    9393  ${OGRE_LIBRARIES}
    94   ${CEGUI_LIBRARIES}
     94  ${CEGUI_LIBRARY}
    9595  ${LUA_LIBRARIES}
    9696  #${CEGUI_SCRIPT_LIBRARIES}
  • code/branches/buildsystem/src/util/CMakeLists.txt

    r1844 r2197  
    1313
    1414ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES})
     15TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARIES})
    1516
    16 IF(TESTING_ENABLED)
    17   ADD_SUBDIRECTORY(testing)
    18 ENDIF(TESTING_ENABLED)
    19 
    20 TARGET_LINK_LIBRARIES(util
    21   ${OGRE_LIBRARIES}
    22 )
     17ADD_SUBDIRECTORY(testing)
  • code/branches/buildsystem/src/util/testing/CMakeLists.txt

    r1505 r2197  
    1 INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES}
    2         ../
    3 )
     1INCLUDE_DIRECTORIES(..)
    42
    5 ADD_EXECUTABLE(TestConverter
    6  TestConverter.cpp
    7 )
     3IF(ENABLE_TESTS)
     4  ADD_EXECUTABLE(TestConverter TestConverter.cpp)
     5ENDIF(ENABLE_TESTS)
    86
    9 
    10 ADD_TEST(TestConverter
    11         ${EXECUTABLE_OUTPUT_PATH}/TestConverter
    12 )
     7ADD_TEST(TestConverter ${EXECUTABLE_OUTPUT_PATH}/TestConverter)
Note: See TracChangeset for help on using the changeset viewer.