[Orxonox-commit 2426] r7135 - in code/branches/presentation3: cmake src/external/ceguilua src/external/ogreceguirenderer src/external/ois src/external/tolua src/libraries/core src/libraries/network src/libraries/tools src/libraries/util src/modules/designtools src/modules/objects src/modules/overlays src/modules/pickup src/modules/pong src/modules/questsystem src/modules/weapons src/orxonox
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Jun 10 00:04:42 CEST 2010
Author: rgrieder
Date: 2010-06-10 00:04:41 +0200 (Thu, 10 Jun 2010)
New Revision: 7135
Modified:
code/branches/presentation3/cmake/TargetUtilities.cmake
code/branches/presentation3/src/external/ceguilua/CMakeLists.txt
code/branches/presentation3/src/external/ogreceguirenderer/CMakeLists.txt
code/branches/presentation3/src/external/ois/CMakeLists.txt
code/branches/presentation3/src/external/tolua/CMakeLists.txt
code/branches/presentation3/src/libraries/core/CMakeLists.txt
code/branches/presentation3/src/libraries/network/CMakeLists.txt
code/branches/presentation3/src/libraries/tools/CMakeLists.txt
code/branches/presentation3/src/libraries/util/CMakeLists.txt
code/branches/presentation3/src/modules/designtools/CMakeLists.txt
code/branches/presentation3/src/modules/objects/CMakeLists.txt
code/branches/presentation3/src/modules/overlays/CMakeLists.txt
code/branches/presentation3/src/modules/pickup/CMakeLists.txt
code/branches/presentation3/src/modules/pong/CMakeLists.txt
code/branches/presentation3/src/modules/questsystem/CMakeLists.txt
code/branches/presentation3/src/modules/weapons/CMakeLists.txt
code/branches/presentation3/src/orxonox/CMakeLists.txt
Log:
Automatically handle DEFINE_SYMBOL for our own libraries.
Also distinguish between static and shared build for DEFINE_SYMBOL.
Modified: code/branches/presentation3/cmake/TargetUtilities.cmake
===================================================================
--- code/branches/presentation3/cmake/TargetUtilities.cmake 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/cmake/TargetUtilities.cmake 2010-06-09 22:04:41 UTC (rev 7135)
@@ -46,6 +46,8 @@
# VERSION: Set version to the binary
# SOURCE_FILES: Source files for the target
# DEFINE_SYMBOL: Sets the DEFINE_SYMBOL target property
+ # Usage: DEFINE_SYMBOL static "symbol" shared "symbol2"
+ # (or shared "symbol2" static "symbol")
# TOLUA_FILES: Files with tolua interface
# PCH_FILE: Precompiled header file
# PCH_EXCLUDE: Source files to be excluded from PCH support
@@ -224,7 +226,22 @@
# DEFINE_SYMBOL
IF(_arg_DEFINE_SYMBOL)
- SET_TARGET_PROPERTIES(${_target_name} PROPERTIES DEFINE_SYMBOL ${_arg_DEFINE_SYMBOL})
+ # Format is: static "static_symbol" shared "shared_symbol"
+ # but the order doesn't matter
+ LIST(LENGTH _arg_DEFINE_SYMBOL _define_symbol_length)
+ IF (_define_symbol_length LESS 2)
+ MESSAGE(FATAL_ERROR "Number of expected arguments for DEFINE_SYMBOL is at least 2: static \"STATIC_SYMBOL\" shared \"SHARED_SYMBOL\"")
+ ENDIF()
+ STRING(TOLOWER "${_arg_STATIC}${_arg_SHARED}" _static_shared_lower)
+ LIST(FIND _arg_DEFINE_SYMBOL ${_static_shared_lower} _symbol_definition_index)
+ MATH(EXPR _symbol_definition_index "${_symbol_definition_index} + 1")
+ IF(_symbol_definition_index LESS _define_symbol_length)
+ LIST(GET _arg_DEFINE_SYMBOL ${_symbol_definition_index} _symbol_definition)
+ SET_TARGET_PROPERTIES(${_target_name} PROPERTIES DEFINE_SYMBOL ${_symbol_definition})
+ ENDIF()
+ ELSEIF(NOT _arg_ORXONOX_EXTERNAL)
+ # Automatically add the macro definitions for our own libraries
+ SET_TARGET_PROPERTIES(${_target_name} PROPERTIES DEFINE_SYMBOL "${_target_name_upper}_${_arg_STATIC}${_arg_SHARED}_BUILD")
ENDIF()
# VERSION
Modified: code/branches/presentation3/src/external/ceguilua/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/external/ceguilua/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/external/ceguilua/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -74,7 +74,7 @@
ORXONOX_EXTERNAL
NO_SOURCE_GROUPS
DEFINE_SYMBOL
- "CEGUILUA_EXPORTS"
+ shared "CEGUILUA_EXPORTS" static "CEGUILUA_STATIC"
VERSION
${CEGUI_VERSION}
LINK_LIBRARIES
Modified: code/branches/presentation3/src/external/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/external/ogreceguirenderer/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/external/ogreceguirenderer/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -35,7 +35,7 @@
${OGRE_LIBRARY}
${CEGUI_LIBRARY}
DEFINE_SYMBOL
- "OGRE_GUIRENDERER_EXPORTS"
+ shared "OGRE_GUIRENDERER_EXPORTS" static "OGRE_GUIRENDERER_STATIC_LIB"
VERSION
1.4.9
SOURCE_FILES
Modified: code/branches/presentation3/src/external/ois/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/external/ois/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/external/ois/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -56,7 +56,7 @@
ORXONOX_ADD_LIBRARY(ois_orxonox
ORXONOX_EXTERNAL
DEFINE_SYMBOL
- "OIS_NONCLIENT_BUILD"
+ shared "OIS_NONCLIENT_BUILD" static ""
VERSION
1.2
SOURCE_FILES
Modified: code/branches/presentation3/src/external/tolua/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/external/tolua/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/external/tolua/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -34,7 +34,7 @@
ORXONOX_ADD_LIBRARY(tolua++_orxonox
ORXONOX_EXTERNAL
DEFINE_SYMBOL
- "TOLUA_SHARED_BUILD"
+ shared "TOLUA_SHARED_BUILD" static "TOLUA_STATIC_BUILD"
VERSION
1.0.92
LINK_LIBRARIES
Modified: code/branches/presentation3/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/libraries/core/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/libraries/core/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -95,8 +95,6 @@
input/InputManager.h
input/KeyBinder.h
input/KeyBinderManager.h
- DEFINE_SYMBOL
- "CORE_SHARED_BUILD"
PCH_FILE
CorePrecompiledHeaders.h
LINK_LIBRARIES
Modified: code/branches/presentation3/src/libraries/network/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/libraries/network/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/libraries/network/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -59,8 +59,6 @@
ADD_SUBDIRECTORY(synchronisable)
ORXONOX_ADD_LIBRARY(network
- DEFINE_SYMBOL
- "NETWORK_SHARED_BUILD"
PCH_FILE
NetworkPrecompiledHeaders.h
LINK_LIBRARIES
Modified: code/branches/presentation3/src/libraries/tools/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/libraries/tools/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/libraries/tools/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -19,8 +19,6 @@
ORXONOX_ADD_LIBRARY(tools
FIND_HEADER_FILES
- DEFINE_SYMBOL
- "TOOLS_SHARED_BUILD"
LINK_LIBRARIES
core
network
Modified: code/branches/presentation3/src/libraries/util/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/libraries/util/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/libraries/util/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -48,8 +48,6 @@
ORXONOX_ADD_LIBRARY(util
FIND_HEADER_FILES
- DEFINE_SYMBOL
- "UTIL_SHARED_BUILD"
LINK_LIBRARIES
${CEGUI_LIBRARY}
${OGRE_LIBRARY}
Modified: code/branches/presentation3/src/modules/designtools/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/designtools/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/designtools/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -7,8 +7,6 @@
ORXONOX_ADD_LIBRARY(designtools
MODULE
FIND_HEADER_FILES
- DEFINE_SYMBOL
- "DESIGNTOOLS_SHARED_BUILD"
LINK_LIBRARIES
orxonox
SOURCE_FILES ${DESIGNTOOLS_SRC_FILES}
Modified: code/branches/presentation3/src/modules/objects/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/objects/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/objects/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -14,8 +14,6 @@
FIND_HEADER_FILES
PCH_FILE
ObjectsPrecompiledHeaders.h
- DEFINE_SYMBOL
- "OBJECTS_SHARED_BUILD"
LINK_LIBRARIES
orxonox
SOURCE_FILES ${OBJECTS_SRC_FILES}
Modified: code/branches/presentation3/src/modules/overlays/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/overlays/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/overlays/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -13,8 +13,6 @@
FIND_HEADER_FILES
PCH_FILE
OverlaysPrecompiledHeaders.h
- DEFINE_SYMBOL
- "OVERLAYS_SHARED_BUILD"
LINK_LIBRARIES
orxonox
SOURCE_FILES ${OVERLAYS_SRC_FILES}
Modified: code/branches/presentation3/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/pickup/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/pickup/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -16,8 +16,6 @@
TOLUA_FILES
PickupManager.h
PickupRepresentation.h
- DEFINE_SYMBOL
- "PICKUP_SHARED_BUILD"
PCH_FILE
PickupPrecompiledHeaders.h
LINK_LIBRARIES
Modified: code/branches/presentation3/src/modules/pong/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/pong/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/pong/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -13,8 +13,6 @@
ORXONOX_ADD_LIBRARY(pong
MODULE
FIND_HEADER_FILES
- DEFINE_SYMBOL
- "PONG_SHARED_BUILD"
LINK_LIBRARIES
orxonox
overlays
Modified: code/branches/presentation3/src/modules/questsystem/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/questsystem/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/questsystem/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -28,8 +28,6 @@
QuestDescription.h
Quest.h
QuestHint.h
- DEFINE_SYMBOL
- "QUESTSYSTEM_SHARED_BUILD"
PCH_FILE
QuestsystemPrecompiledHeaders.h
LINK_LIBRARIES
Modified: code/branches/presentation3/src/modules/weapons/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/modules/weapons/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/modules/weapons/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -12,8 +12,6 @@
FIND_HEADER_FILES
PCH_FILE
WeaponsPrecompiledHeaders.h
- DEFINE_SYMBOL
- "WEAPONS_SHARED_BUILD"
LINK_LIBRARIES
orxonox
# TODO: Remove this as soon as projectiles aren't hardcoded anymore buth rather defined in XML
Modified: code/branches/presentation3/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/CMakeLists.txt 2010-06-09 21:51:42 UTC (rev 7134)
+++ code/branches/presentation3/src/orxonox/CMakeLists.txt 2010-06-09 22:04:41 UTC (rev 7135)
@@ -63,8 +63,6 @@
interfaces/Pickupable.h
infos/PlayerInfo.h
sound/SoundManager.h
- DEFINE_SYMBOL
- "ORXONOX_SHARED_BUILD"
PCH_FILE
OrxonoxPrecompiledHeaders.h
LINK_LIBRARIES
More information about the Orxonox-commit
mailing list