Changeset 2518
- Timestamp:
- Dec 21, 2008, 10:36:51 PM (16 years ago)
- Location:
- code/branches/buildsystem2
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/AddSourceFiles.cmake
r2131 r2518 16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 17 17 18 MACRO(ADD_SOURCE_DIRECTORY _target_list _directory) 18 # BIG FAT NOTE: 19 # There's possibly a bug in the CMake behaviour when using PARENT_SCOPE. 20 # It seems like the parent variable doesn't get updated locally but written 21 # correclty to the parent scope. So accessing a parent variable will always 22 # return its value BEFORE the local scope was created! Mind this when 23 # updating to a new CMake version. 19 24 20 # Subfolder puts source files into CMake Cache variable _CACHED_SOURCE_FILES 25 # Adds source files to the internal handler 26 MACRO(ADD_SOURCE_FILES) 27 28 # Write to parent scoped variables AND to our own scope 29 # (Also see the big fat note at the beginning of the file) 30 # --> _source_files_internal_parent stays constant here, not matter what! 31 SET(_source_files_internal_local ${_source_files_internal_local} ${ARGN}) 32 SET(_source_files_internal_parent ${_source_files_internal_local} PARENT_SCOPE) 33 34 ENDMACRO(ADD_SOURCE_FILES) 35 36 37 # Adds a subdirectory to the internal souce file handler 38 MACRO(ADD_SOURCE_DIRECTORY _directory) 39 40 # Save variable 41 SET(_source_files_internal_temp ${_source_files_internal_local}) 42 # Clear the local variable because we use it in the child scope 43 SET(_source_files_internal_local) 44 45 # Subfolder puts source files into CMake variable _source_files_internal_parent 21 46 ADD_SUBDIRECTORY(${_directory}) 47 # Recover our own local variable 48 SET(_source_files_internal_local ${_source_files_internal_temp}) 22 49 23 50 # Put the directory name in front of each source file from the subfolder 24 # and add it to the source list in the current directory25 FOREACH(_source_file ${_ CACHED_SOURCE_FILES})26 LIST(APPEND ${_target_list}"${_directory}/${_source_file}")51 SET(_source_files_internal_temp) 52 FOREACH(_source_file ${_source_files_internal_parent}) 53 LIST(APPEND _source_files_internal_temp "${_directory}/${_source_file}") 27 54 ENDFOREACH(_source_file) 55 56 # Add the content of the temporary list 57 ADD_SOURCE_FILES(${_source_files_internal_temp}) 28 58 29 59 ENDMACRO(ADD_SOURCE_DIRECTORY) 30 60 61 # Writes the content from the internal variables to a user specified one 62 MACRO(WRITE_SOURCE_FILES _variable_name) 31 63 32 MACRO(ADD_SOURCE_FILES _source_list) 33 34 # Put the source file into a variable that still exists in this_folder/../ 35 # Use FORCE to always overwrite the cache variable 36 SET(_CACHED_SOURCE_FILES ${${_source_list}} CACHE STRING "" FORCE) 37 MARK_AS_ADVANCED(_CACHED_SOURCE_FILES FORCE) 64 SET(${_variable_name} ${_source_files_internal_local}) 38 65 39 ENDMACRO( ADD_SOURCE_FILES)66 ENDMACRO(WRITE_SOURCE_FILES) -
code/branches/buildsystem2/src/core/CMakeLists.txt
r2510 r2518 1 SET(CORE_SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Clock.cc 3 3 ConfigFileManager.cc … … 41 41 TclBind.cc 42 42 TclThreadManager.cc 43 44 43 ) 45 44 46 ADD_SOURCE_DIRECTORY(CORE_SRC_FILES input) 45 ADD_SOURCE_DIRECTORY(input) 46 47 WRITE_SOURCE_FILES(CORE_SRC_FILES) 47 48 48 49 INCLUDE(UseTolua) -
code/branches/buildsystem2/src/core/input/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Button.cc 3 3 CalibratorCallback.cc … … 12 12 SimpleInputState.cc 13 13 ) 14 15 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/network/CMakeLists.txt
r2510 r2518 1 SET( NETWORK_SRC_FILES 1 ADD_SOURCE_FILES( 2 2 ChatListener.cc 3 3 Client.cc … … 15 15 ) 16 16 17 ADD_SOURCE_DIRECTORY( NETWORK_SRC_FILESpacket)17 ADD_SOURCE_DIRECTORY(packet) 18 18 19 WRITE_SOURCE_FILES(NETWORK_SRC_FILES) 19 20 IF(WIN32) 20 21 ADD_LIBRARY( network ${NETWORK_SRC_FILES} ) -
code/branches/buildsystem2/src/network/packet/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Packet.cc 3 3 Chat.cc … … 8 8 DeleteObjects.cc 9 9 ) 10 11 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/CMakeLists.txt
r2510 r2518 1 SET( ORXONOX_SRC_FILES 1 ADD_SOURCE_FILES( 2 2 CameraManager.cc 3 3 GraphicsEngine.cc … … 8 8 ) 9 9 10 ADD_SOURCE_DIRECTORY(ORXONOX_SRC_FILES gamestates) 11 ADD_SOURCE_DIRECTORY(ORXONOX_SRC_FILES gui) 12 ADD_SOURCE_DIRECTORY(ORXONOX_SRC_FILES objects) 13 ADD_SOURCE_DIRECTORY(ORXONOX_SRC_FILES overlays) 14 ADD_SOURCE_DIRECTORY(ORXONOX_SRC_FILES tools) 10 ADD_SOURCE_DIRECTORY(gamestates) 11 ADD_SOURCE_DIRECTORY(gui) 12 ADD_SOURCE_DIRECTORY(objects) 13 ADD_SOURCE_DIRECTORY(overlays) 14 ADD_SOURCE_DIRECTORY(tools) 15 16 WRITE_SOURCE_FILES(ORXONOX_SRC_FILES) 15 17 16 18 INCLUDE(UseTolua) 17 19 TOLUA(Orxonox ORXONOX_SRC_FILES INPUTFILES gui/GUIManager.h) 18 20 19 20 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} ) 21 ADD_EXECUTABLE(orxonox ${ORXONOX_SRC_FILES}) 21 22 22 23 IF(NETWORKTRAFFIC_TESTING_ENABLED) -
code/branches/buildsystem2/src/orxonox/gamestates/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 GSDedicated.cc 3 3 GSClient.cc … … 10 10 GSStandalone.cc 11 11 ) 12 13 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/gui/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 GUIManager.cc 3 3 OgreCEGUIRenderer.cpp … … 5 5 OgreCEGUITexture.cpp 6 6 ) 7 8 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/CMakeLists.txt
r2171 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 EventListener.cc 3 3 EventDispatcher.cc … … 13 13 ) 14 14 15 ADD_SOURCE_DIRECTORY(SRC_FILES controllers) 16 ADD_SOURCE_DIRECTORY(SRC_FILES gametypes) 17 ADD_SOURCE_DIRECTORY(SRC_FILES infos) 18 #ADD_SOURCE_DIRECTORY(SRC_FILES pickup) 19 ADD_SOURCE_DIRECTORY(SRC_FILES quest) 20 ADD_SOURCE_DIRECTORY(SRC_FILES weaponSystem) 21 ADD_SOURCE_DIRECTORY(SRC_FILES worldentities) 22 23 ADD_SOURCE_FILES(SRC_FILES) 15 ADD_SOURCE_DIRECTORY(controllers) 16 ADD_SOURCE_DIRECTORY(gametypes) 17 ADD_SOURCE_DIRECTORY(infos) 18 #ADD_SOURCE_DIRECTORY(pickup) 19 ADD_SOURCE_DIRECTORY(quest) 20 ADD_SOURCE_DIRECTORY(weaponSystem) 21 ADD_SOURCE_DIRECTORY(worldentities) -
code/branches/buildsystem2/src/orxonox/objects/controllers/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Controller.cc 3 3 HumanController.cc 4 4 ) 5 6 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/gametypes/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Gametype.cc 3 3 ) 4 5 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/infos/CMakeLists.txt
r2171 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Info.cc 3 3 PlayerInfo.cc 4 4 HumanPlayer.cc 5 5 ) 6 7 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/pickup/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 ShipEquipmentClasses.cc 3 3 ShipItem.cc 4 4 ) 5 6 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/quest/CMakeLists.txt
r2261 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 AddQuest.cc 3 3 AddQuestHint.cc … … 17 17 Rewardable.cc 18 18 ) 19 20 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/weaponSystem/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Munition.cc 3 3 Weapon.cc … … 7 7 ) 8 8 9 #ADD_SOURCE_DIRECTORY(SRC_FILES munitions) 10 #ADD_SOURCE_DIRECTORY(SRC_FILES projectiles) 11 #ADD_SOURCE_DIRECTORY(SRC_FILES weapons) 12 13 ADD_SOURCE_FILES(SRC_FILES) 9 #ADD_SOURCE_DIRECTORY(munitions) 10 #ADD_SOURCE_DIRECTORY(projectiles) 11 #ADD_SOURCE_DIRECTORY(weapons) -
code/branches/buildsystem2/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 LaserGunMunition.cc 3 3 ) 4 5 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/weaponSystem/projectiles/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 BillboardProjectile.cc 3 3 ParticleProjectile.cc 4 4 Projectile.cc 5 5 ) 6 7 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 LaserGun.cc 3 3 Missile.cc 4 4 ) 5 6 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/worldentities/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 WorldEntity.cc 3 3 PositionableEntity.cc … … 16 16 ) 17 17 18 ADD_SOURCE_DIRECTORY(SRC_FILES pawns) 19 ADD_SOURCE_DIRECTORY(SRC_FILES triggers) 20 21 ADD_SOURCE_FILES(SRC_FILES) 18 ADD_SOURCE_DIRECTORY(pawns) 19 ADD_SOURCE_DIRECTORY(triggers) -
code/branches/buildsystem2/src/orxonox/objects/worldentities/pawns/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Spectator.cc 3 3 Pawn.cc 4 4 SpaceShip.cc 5 5 ) 6 7 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
r2261 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 Trigger.cc 3 3 DistanceTrigger.cc … … 5 5 PlayerTrigger.cc 6 6 ) 7 8 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/overlays/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 OrxonoxOverlay.cc 3 3 OverlayGroup.cc … … 5 5 ) 6 6 7 ADD_SOURCE_DIRECTORY(SRC_FILES console) 8 ADD_SOURCE_DIRECTORY(SRC_FILES debug) 9 ADD_SOURCE_DIRECTORY(SRC_FILES hud) 10 11 ADD_SOURCE_FILES(SRC_FILES) 7 ADD_SOURCE_DIRECTORY(console) 8 ADD_SOURCE_DIRECTORY(debug) 9 ADD_SOURCE_DIRECTORY(hud) -
code/branches/buildsystem2/src/orxonox/overlays/console/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 InGameConsole.cc 3 3 ) 4 5 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/overlays/debug/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 DebugFPSText.cc 3 3 DebugRTRText.cc 4 4 ) 5 6 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/overlays/hud/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 HUDBar.cc 3 3 HUDNavigation.cc … … 6 6 ChatOverlay.cc 7 7 ) 8 9 ADD_SOURCE_FILES(SRC_FILES) -
code/branches/buildsystem2/src/orxonox/tools/CMakeLists.txt
r2131 r2518 1 SET( SRC_FILES 1 ADD_SOURCE_FILES( 2 2 BillboardSet.cc 3 3 Mesh.cc … … 7 7 WindowEventListener.cc 8 8 ) 9 10 ADD_SOURCE_FILES(SRC_FILES)
Note: See TracChangeset
for help on using the changeset viewer.