Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7421 for sandbox_qt/cmake


Ignore:
Timestamp:
Sep 12, 2010, 12:47:30 AM (14 years ago)
Author:
rgrieder
Message:

Basic stuff up and running for the Qt sandbox.
No GUI support yet.

Location:
sandbox_qt/cmake
Files:
4 edited
4 copied

Legend:

Unmodified
Added
Removed
  • sandbox_qt/cmake/CompilerConfigGCC.cmake

    r7416 r7421  
    3737)
    3838
    39 # Complain about incompatibilities
    40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
    41 IF(NOT _compare_result LESS 0)
    42   IF(${Boost_VERSION} LESS 103700)
    43     MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
    44   ENDIF()
    45 ENDIF()
    46 
    4739# GCC may not support #pragma GCC system_header correctly when using
    4840# templates. According to Bugzilla, it was fixed March 07 but tests
     
    8173# For GCC older than version 4, do not display sign compare warnings
    8274# because of boost::filesystem (which creates about a hundred per include)
    83 ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
     75#ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
    8476
    8577# For newer GCC (4.3 and above), don't display hundreds of annoying deprecated
  • sandbox_qt/cmake/InstallConfig.cmake

    r7163 r7421  
    4343SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
    4444SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    45 SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
    4645SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    4746SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
     
    5554    SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox)
    5655    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static)
    57     SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules)
    5856    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    5957    SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/games/orxonox)
  • sandbox_qt/cmake/LibraryConfig.cmake

    r7243 r7421  
    4040# On Windows using a package causes way less problems
    4141SET(_option_msg "Set this to true to use precompiled dependecy archives")
    42 IF(WIN32)
    43   OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON)
    44 ELSE(WIN32)
    45   OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE)
    46 ENDIF(WIN32)
     42OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE)
    4743
    4844# Scripts for specific library and CMake config
    4945INCLUDE(LibraryConfigTardis)
    50 INCLUDE(LibraryConfigApple)
    5146
    5247IF(DEPENDENCY_PACKAGE_ENABLE)
     
    9388# Performs the search and sets the variables    #
    9489
    95 FIND_PACKAGE(OGRE  1.4       REQUIRED)
    96 FIND_PACKAGE(ENet  1.1       REQUIRED)
    97 FIND_PACKAGE(Ogg             REQUIRED)
    98 FIND_PACKAGE(Vorbis          REQUIRED)
    99 FIND_PACKAGE(ALUT            REQUIRED)
    100 FIND_PACKAGE(ZLIB            REQUIRED)
    101 IF(POCO_REQUIRED)
    102   FIND_PACKAGE(POCO          REQUIRED)
    103 ENDIF()
    104 IF(WIN32)
    105   FIND_PACKAGE(DirectX       REQUIRED)
    106 ENDIF()
    107 
    108 ##### CEGUI #####
    109 # We make use of the CEGUI script module called CEGUILua.
    110 # However there is a small issue with that: We use Tolua, a C++ binding
    111 # generator ourselves. And we also have to use our bindings in the same
    112 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime
    113 # version are equal or else you get segmentation faults.
    114 # In order to match the Lua versions we decided to ship CEGUILua in our
    115 # repository, mainly because there is no way to determine which version of
    116 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly
    117 # because we can then choose the Lua version. Future plans might involve only
    118 # accepting Lua 5.1.
    119 
    120 # Insert all internally supported CEGUILua versions here
    121 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)
    122 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)
    123 FIND_PACKAGE(CEGUI 0.5 REQUIRED)
    124 
    125 ##### Lua #####
    126 IF(CEGUILUA_USE_EXTERNAL_LIBRARY)
    127   COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)
    128   IF(version_comparison LESS 0)
    129     SET(LUA_VERSION_REQUEST 5.0)
    130   ELSE()
    131     SET(LUA_VERSION_REQUEST 5.1)
    132   ENDIF()
    133 ELSE()
    134   SET(LUA_VERSION_REQUEST 5)
    135 ENDIF()
    136 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    137 
    138 ##### OpenAL #####
    139 FIND_PACKAGE(OpenAL REQUIRED)
    140 # Also use parent include dir (without AL/) for ALUT
    141 IF(OPENAL_INCLUDE_DIR MATCHES "/AL$")
    142   GET_FILENAME_COMPONENT(ALT_OPENAL_INCLUDE_DIR ${OPENAL_INCLUDE_DIR} PATH)
    143 ENDIF()
    144 SET(OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR} ${ALT_OPENAL_INCLUDE_DIR})
    145 # Notfiy user
    146 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
    147 # Hide variables created by the script
    148 MARK_AS_ADVANCED(OPENAL_INCLUDE_DIR OPENAL_LIBRARY)
    149 
    150 ##### Tcl #####
    151 # We only require Tcl, so avoid confusing user about other Tcl stuff by
    152 # applying a little workaround
    153 SET(Tclsh_FIND_QUIETLY TRUE)
    154 FIND_PACKAGE(TCL QUIET)
    155 # Display messages separately
    156 SET(TCL_FIND_QUIETLY FALSE)
    157 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
    158 
    159 ##### Boost #####
    160 # Expand the next statement if newer boost versions than 1.36.1 are released
    161 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0
    162                               1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0)
    163 IF( NOT TARDIS )
    164   FIND_PACKAGE(Boost 1.35 REQUIRED thread filesystem system date_time)
    165 ENDIF()
    166 # No auto linking, so this option is useless anyway
    167 MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
     90FIND_PACKAGE(QT4 COMPONENTS QtCore QtGui REQUIRED)
    16891
    16992
     
    17497# Note: Default option in the libraries vary, but our default option is dynamic
    17598IF(WIN32)
    176   OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE)
    177   OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE)
    178   OPTION(LINK_ENET_DYNAMIC  "Link ENet dynamically on Windows" TRUE)
    179   OPTION(LINK_OGRE_DYNAMIC  "Link OGRE dynamically on Windows" TRUE)
    180   OPTION(LINK_TCL_DYNAMIC   "Link TCL dynamically on Windows" TRUE)
    181   OPTION(LINK_ZLIB_DYNAMIC  "Link ZLib dynamically on Windows" TRUE)
    182   COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison)
    183   IF(_version_comparison LESS 0)
    184     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE)
    185   ELSE(_version_comparison LESS 0)
    186     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    187   ENDIF(_version_comparison LESS 0)
     99    #OPTION(LINK_ZLIB_DYNAMIC  "Link ZLib dynamically on Windows" TRUE)
    188100
    189101  IF(DEPENDENCY_PACKAGE_ENABLE)
    190     MARK_AS_ADVANCED(
    191       LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC LINK_ENET_DYNAMIC
    192       LINK_OGRE_DYNAMIC  LINK_TCL_DYNAMIC   LINK_ZLIB_DYNAMIC
    193       LINK_LUA_DYNAMIC
    194     )
     102    #MARK_AS_ADVANCED(
     103      #LINK_ZLIB_DYNAMIC
     104    #)
    195105  ENDIF()
    196106ENDIF(WIN32)
    197 
    198 
    199 ################# OGRE Plugins ##################
    200 
    201 # More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
    202 SET(OGRE_PLUGINS_INT Plugin_ParticleFX)
    203 IF(WIN32)
    204   # CG program manager is probably DirectX related (not available under unix)
    205   LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)
    206 ENDIF(WIN32)
    207 SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING
    208    "Specify which OGRE plugins to load. Existance check is performed.")
    209 
    210 # Check the plugins and determine the plugin folder
    211 # You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
    212 INCLUDE(CheckOGREPlugins)
    213 CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})
    214 
  • sandbox_qt/cmake/LibraryConfigTardis.cmake

    r7418 r7421  
    2121 #    Adrian Friedli
    2222 #  Description:
    23  #    Sets the correct find script paths on the ETH Tardis workstations.
    24  #    Also sets the TARDIS variable.
     23 #    Sets the TARDIS variable.
    2524 #
    2625
     
    3332  ENDIF()
    3433ENDIF()
    35 
    36 IF(TARDIS)
    37   MESSAGE(STATUS "Running on D-ITET isg.ee Tardis Computer. Using customized paths.")
    38 
    39 #  SET(CMAKE_C_COMPILER "gcc-4.1.1")
    40 #  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
    41 
    42   # Note: When setting ENV${} variables, make sure to use quotes when
    43   #       having multiple directories.
    44   #SET(BOOST_INCLUDEDIR "/usr/pack/boost-1.42.0-bs/include")
    45   #SET(BOOST_LIBRARYDIR "/usr/pack/boost-1.42.0-bs/i686-debian-linux4.0/lib")
    46   SET(Boost_VERSION 104200)
    47   SET(Boost_INCLUDE_DIRS "/usr/pack/boost-1.42.0-bs/include" CACHE PATH "")
    48   SET(Boost_SYSTEM_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_system.so" CACHE PATH "")
    49   SET(Boost_SYSTEM_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_system-d.so" CACHE PATH "")
    50   SET(Boost_DATE_TIME_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_date_time.so" CACHE PATH "")
    51   SET(Boost_DATE_TIME_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_date_time-d.so" CACHE PATH "")
    52   SET(Boost_FILESYSTEM_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_filesystem.so" CACHE PATH "")
    53   SET(Boost_FILESYSTEM_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_filesystem-d.so" CACHE PATH "")
    54   SET(Boost_THREAD_LIBRARY_RELEASE "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_thread-mt.so" CACHE PATH "")
    55   SET(Boost_THREAD_LIBRARY_DEBUG "/usr/pack/boost-1.42.0-bs/i686-debian-linux5.0/lib/libboost_thread-mt-d.so" CACHE PATH "")
    56 
    57   SET(Boost_SYSTEM_LIBRARY "debug;${Boost_SYSTEM_LIBRARY_DEBUG};optimized;${Boost_SYSTEM_LIBRARY_RELEASE}" CACHE PATH "" FORCE)
    58   SET(Boost_DATE_TIME_LIBRARY "debug;${Boost_DATE_TIME_LIBRARY_DEBUG};optimized;${Boost_DATE_TIME_LIBRARY_RELEASE}" CACHE PATH "" FORCE)
    59   SET(Boost_FILESYSTEM_LIBRARY "debug;${Boost_FILESYSTEM_LIBRARY_DEBUG};optimized;${Boost_FILESYSTEM_LIBRARY_RELEASE}" CACHE PATH "" FORCE)
    60   SET(Boost_THREAD_LIBRARY "debug;${Boost_THREAD_LIBRARY_DEBUG};optimized;${Boost_THREAD_LIBRARY_RELEASE}" CACHE PATH "" FORCE)
    61 
    62   MARK_AS_ADVANCED( Boost_INCLUDE_DIRS )
    63   MARK_AS_ADVANCED( Boost_SYSTEM_LIBRARY Boost_SYSTEM_LIBRARY_RELEASE Boost_SYSTEM_LIBRARY_DEBUG )
    64   MARK_AS_ADVANCED( Boost_DATE_TIME_LIBRARY Boost_DATE_TIME_LIBRARY_RELEASE Boost_DATE_TIME_LIBRARY_DEBUG )
    65   MARK_AS_ADVANCED( Boost_FILESYSTEM_LIBRARY Boost_FILESYSTEM_LIBRARY_RELEASE Boost_FILESYSTEM_LIBRARY_DEBUG )
    66   MARK_AS_ADVANCED( Boost_THREAD_LIBRARY Boost_THREAD_LIBRARY_RELEASE Boost_THREAD_LIBRARY_DEBUG )
    67 
    68 
    69   LIST(APPEND CMAKE_INCLUDE_PATH "/usr/pack/cegui-0.6.2-sd")
    70   LIST(APPEND CMAKE_LIBRARY_PATH "/usr/pack/cegui-0.6.2-sd/i686-debian-linux5.0")
    71   LIST(APPEND CMAKE_INCLUDE_PATH "/usr/pack/ogre-1.6.1-sd")
    72   LIST(APPEND CMAKE_LIBRARY_PATH "/usr/pack/ogre-1.6.1-sd/i686-debian-linux5.0")
    73 
    74   #SET(ENV{CEGUIDIR}    "/usr/pack/cegui-0.6.2-sd;/usr/pack/cegui-0.6.2-sd/i686-debian-linux5.0")
    75   #SET(ENV{ENETDIR}     "/usr/pack/enet-1.2-sd;/usr/pack/enet-1.2-sd/i686-debian-linux4.0")
    76   #SET(ENV{ALUTDIR}     "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
    77   #SET(ENV{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    78   #SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    79   #SET(ENV{LUA_DIR}     "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
    80   #SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")
    81   #SET(ENV{OPENALDIR}   "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
    82   #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
    83 ENDIF(TARDIS)
  • sandbox_qt/cmake/PackageConfig.cmake

    r7418 r7421  
    2525 #
    2626
    27 # Check package version info
    28 # MAJOR: Breaking change
    29 # MINOR: No breaking changes by the dependency package
    30 #        For example any code running on 3.0 should still run on 3.1
    31 #        But you can specify that the code only runs on 3.1 and higher
    32 #        or 4.0 and higher (so both 3.1 and 4.0 will work).
    33 SET(ALLOWED_MINIMUM_VERSIONS 3.1 4.0 5.0)
    34 
    35 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
    36   SET(DEPENDENCY_VERSION 1.0)
    37 ELSE()
    38   # Get version from file
    39   FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
    40   SET(_match)
    41   STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
    42   IF(_match)
    43     SET(DEPENDENCY_VERSION ${_match})
    44   ELSE()
    45     MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
    46   ENDIF()
    47 ENDIF()
    48 
    49 INCLUDE(CompareVersionStrings)
    50 SET(_version_match FALSE)
    51 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})
    52   # Get major version
    53   STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
    54   COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
    55   IF(_result EQUAL 0)
    56     COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
    57     IF(NOT _result LESS 0)
    58       SET(_version_match TRUE)
    59     ENDIF()
    60   ENDIF()
    61 ENDFOREACH(_version)
    62 IF(NOT _version_match)
    63   MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
    64           "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"
    65           "You can get a new version from www.orxonox.net")
    66 ENDIF()
    67 
    6827IF(NOT _INTERNAL_PACKAGE_MESSAGE)
    6928  MESSAGE(STATUS "Using library package for the dependencies.")
     
    7130ENDIF()
    7231
    73 # Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading
    74 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE)
    75 IF(NOT _result EQUAL -1 AND NOT MINGW)
    76     SET(POCO_REQUIRED TRUE)
    77 ENDIF()
    78 
    7932# Include paths and other special treatments
    80 SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut)
    81 SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost)
    82 SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui)
    83 SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
    84 SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
    85 SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
    86 SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
    87 SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
    88 SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre)
    89 SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
    90 SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal)
    91 SET(ENV{POCODIR}               ${DEP_INCLUDE_DIR}/poco)
    92 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include)
    93 LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib/include)
     33#SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut)
     34#LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl/include)
    9435
    9536### INSTALL ###
    96 
    97 # Tcl script library
    98 INSTALL(
    99   DIRECTORY ${DEP_LIBRARY_DIR}/tcl/
    100   DESTINATION lib/tcl
    101 )
    10237
    10338# On Windows, DLLs have to be in the executable folder, install them
  • sandbox_qt/cmake/PackageConfigMSVC.cmake

    r7418 r7421  
    5454  # Certain find scripts don't behave as ecpected to we have
    5555  # to specify the libraries ourselves.
    56   SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    57   SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     56  #SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    5857
    5958  # Visual Leak Detector
  • sandbox_qt/cmake/PackageConfigMinGW.cmake

    r7418 r7421  
    4747  # Certain find scripts don't behave as ecpected to we have
    4848  # to specify the libraries ourselves.
    49   SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    50   SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
     49  #SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    5150
    5251ENDIF(MINGW)
  • sandbox_qt/cmake/tools/TargetUtilities.cmake

    r7416 r7421  
    3434 #      NO_DLL_INTERFACE:  Link statically with MSVC
    3535 #      NO_SOURCE_GROUPS:  Don't create msvc source groups
    36  #      MODULE:            For dynamic module libraries (libraries only)
    3736 #      WIN32:             Inherited from ADD_EXECUTABLE (executables only)
    3837 #      PCH_NO_DEFAULT:    Do not make precompiled header files default if
     
    4645 #      SOURCE_FILES:      Source files for the target
    4746 #      DEFINE_SYMBOL:     Sets the DEFINE_SYMBOL target property
    48  #      TOLUA_FILES:       Files with tolua interface
    4947 #      PCH_FILE:          Precompiled header file
    5048 #      PCH_EXCLUDE:       Source files to be excluded from PCH support
    5149 #      OUTPUT_NAME:       If you want a different name than the target name
     50 #      QT_MOC_FILES:      List of files to be processed by Qt MOC
     51 #      QT_UIC_FILES:      List of files to be processed by Qt UIC
    5252 #  Note:
    5353 #    This function also installs the target!
     
    6060INCLUDE(CMakeDependentOption)
    6161INCLUDE(CapitaliseName)
    62 INCLUDE(GenerateToluaBindings)
    6362INCLUDE(ParseMacroArguments)
    6463INCLUDE(SourceFileUtilities)
     
    6867
    6968MACRO(ORXONOX_ADD_LIBRARY _target_name)
    70   TU_ADD_TARGET(${_target_name} LIBRARY "MODULE" ${ARGN})
     69  TU_ADD_TARGET(${_target_name} LIBRARY "" ${ARGN})
    7170ENDMACRO(ORXONOX_ADD_LIBRARY)
    7271
     
    8584                  NO_INSTALL         NO_VERSION        ${_additional_switches})
    8685  SET(_list_names LINK_LIBRARIES     VERSION           SOURCE_FILES
    87                   DEFINE_SYMBOL      TOLUA_FILES       PCH_FILE
    88                   PCH_EXCLUDE        OUTPUT_NAME)
     86                  DEFINE_SYMBOL      PCH_FILE          PCH_EXCLUDE
     87                  OUTPUT_NAME        QT_MOC_FILES      QT_UIC_FILES)
    8988
    9089  PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
     
    107106  ENDIF()
    108107
    109   # Combine source and header files
     108  # Combine source, header and QT designer files
    110109  SET(_${_target_name}_files
    111110    ${_${_target_name}_header_files}
    112111    ${_${_target_name}_source_files}
     112    ${_arg_QT_UIC_FILES}
    113113  )
    114114  # Remove potential duplicates
    115115  LIST(REMOVE_DUPLICATES _${_target_name}_files)
    116116
    117   # TOLUA_FILES
    118   IF(_arg_TOLUA_FILES)
    119     GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
    120                             INPUTFILES ${_arg_TOLUA_FILES})
     117  # QT MOC and UIC preprocessing
     118  IF(_arg_QT_MOC_FILES)
     119      QT4_WRAP_CPP(_${_target_name}_files ${_arg_QT_MOC_FILES})
     120  ENDIF()
     121  IF(_arg_QT_UIC_FILES)
     122      QT4_WRAP_UI(_${_target_name}_files ${_arg_QT_UIC_FILES})
    121123  ENDIF()
    122124
     
    208210  ENDIF()
    209211
    210   # Configure modules
    211   IF (_arg_MODULE)
    212     SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
    213       RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows
    214       LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix
    215     )
    216     ADD_MODULE(${_target_name})
    217     # Ensure that the main program depends on the module
    218     SET(ORXONOX_MODULES ${ORXONOX_MODULES} ${_target_name} CACHE STRING "" FORCE)
    219   ENDIF()
    220 
    221212  # LINK_LIBRARIES
    222213  IF(_arg_LINK_LIBRARIES)
     
    251242  # Install all targets except for static ones (executables also have SHARED in _link_mode)
    252243  IF(${_link_mode} STREQUAL "SHARED" AND NOT _arg_NO_INSTALL)
    253     IF(_arg_MODULE)
    254       INSTALL(TARGETS ${_target_name}
    255         RUNTIME DESTINATION ${MODULE_INSTALL_DIRECTORY}
    256         LIBRARY DESTINATION ${MODULE_INSTALL_DIRECTORY}
    257       )
    258     ELSE()
    259       INSTALL(TARGETS ${_target_name}
    260         RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY}
    261         LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY}
    262       )
    263     ENDIF()
     244    INSTALL(TARGETS ${_target_name}
     245      RUNTIME DESTINATION ${RUNTIME_INSTALL_DIRECTORY}
     246      LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY}
     247    )
    264248  ENDIF()
    265249
    266250ENDMACRO(TU_ADD_TARGET)
    267 
    268 
    269 # Creates a helper file with name <name_of_the_library>${ORXONOX_MODULE_EXTENSION}
    270 # This helps finding dynamically loadable modules at runtime
    271 
    272 FUNCTION(ADD_MODULE _target)
    273   # We use the properties to get the name because the librarys name may differ from
    274   # the target name (for example orxonox <-> liborxonox)
    275 
    276   GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)
    277   GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)
    278 
    279   IF(CMAKE_CONFIGURATION_TYPES)
    280     FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
    281       SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})
    282 
    283       FILE(WRITE ${_module_filename})
    284 
    285       INSTALL(
    286         FILES ${_module_filename}
    287         DESTINATION ${MODULE_INSTALL_DIRECTORY}
    288         CONFIGURATIONS ${_config}
    289       )
    290     ENDFOREACH()
    291   ELSE()
    292     SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})
    293 
    294     FILE(WRITE ${_module_filename})
    295 
    296     INSTALL(
    297       FILES ${_module_filename}
    298       DESTINATION ${MODULE_INSTALL_DIRECTORY}
    299     )
    300   ENDIF()
    301 ENDFUNCTION(ADD_MODULE)
Note: See TracChangeset for help on using the changeset viewer.