Changeset 5613
- Timestamp:
- Aug 10, 2009, 4:44:05 PM (15 years ago)
- Location:
- code/branches/libraries
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libraries/cmake/TargetUtilities.cmake
r3371 r5613 44 44 # PCH_FILE: Precompiled header file 45 45 # PCH_EXCLUDE: Source files to be excluded from PCH support 46 # OUTPUT_NAME: If you want a different name than the target name 46 47 # Note: 47 48 # This function also installs the target! … … 77 78 PCH_NO_DEFAULT NO_INSTALL) 78 79 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES DEFINE_SYMBOL 79 TOLUA_FILES PCH_FILE PCH_EXCLUDE )80 TOLUA_FILES PCH_FILE PCH_EXCLUDE OUTPUT_NAME) 80 81 PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN}) 81 82 … … 168 169 ENDIF() 169 170 171 # OUTPUT_NAME 172 IF(_arg_OUTPUT_NAME ) 173 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES OUTPUT_NAME ${_arg_OUTPUT_NAME}) 174 ENDIF() 175 170 176 # Second part of precompiled header files 171 177 IF(PCH_COMPILER_SUPPORT AND PCH_ENABLE_${_target_name_upper} AND _arg_PCH_FILE) -
code/branches/libraries/src/orxonox/CMakeLists.txt
r3370 r5613 37 37 ENDIF() 38 38 39 ORXONOX_ADD_ EXECUTABLE(orxonox39 ORXONOX_ADD_LIBRARY(orxonox 40 40 FIND_HEADER_FILES 41 41 TOLUA_FILES … … 45 45 objects/quest/QuestDescription.h 46 46 objects/quest/QuestManager.h 47 DEFINE_SYMBOL 48 "ORXONOX_SHARED_BUILD" 47 49 PCH_FILE 48 50 OrxonoxPrecompiledHeaders.h 49 # When defined as WIN32 this removes the console window on Windows50 ${ORXONOX_WIN32}51 51 LINK_LIBRARIES 52 52 ${Boost_FILESYSTEM_LIBRARY} … … 69 69 ) 70 70 71 GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION) 71 ORXONOX_ADD_EXECUTABLE(orxonox-main 72 FIND_HEADER_FILES 73 # When defined as WIN32 this removes the console window on Windows 74 ${ORXONOX_WIN32} 75 LINK_LIBRARIES 76 orxonox 77 SOURCE_FILES 78 Orxonox.cc 79 OUTPUT_NAME orxonox 80 ) 81 82 GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION) 72 83 GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME) 73 84 SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "") -
code/branches/libraries/src/orxonox/Main.cc
r3370 r5613 27 27 * 28 28 */ 29 29 30 30 /** 31 31 @file 32 32 @brief 33 Entry point of the program.33 The main function of Orxonox. 34 34 */ 35 35 … … 37 37 #include "SpecialConfig.h" 38 38 39 #ifdef ORXONOX_USE_WINMAIN40 # ifndef WIN32_LEAN_AND_MEAN41 # define WIN32_LEAN_AND_MEAN42 # endif43 #include <windows.h>44 #endif45 46 #include "util/Debug.h"47 39 #include "util/Exception.h" 48 40 #include "core/CommandLine.h" 49 41 #include "core/Game.h" 42 #include "Main.h" 50 43 51 44 SetCommandLineSwitch(console).information("Start in console mode (text IO only)"); … … 56 49 SetCommandLineSwitch(standalone).information("Start in standalone mode"); 57 50 58 /* 59 @brief 60 Main method. Game starts here (except for static initialisations). 61 */ 62 #ifdef ORXONOX_USE_WINMAIN 63 INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT) 64 #else 65 int main(int argc, char** argv) 66 #endif 51 namespace orxonox 67 52 { 68 using namespace orxonox; 69 70 Game* game = 0; 71 try 53 /** 54 @brief 55 Main method. Game starts here (except for static initialisations). 56 */ 57 int main(const std::string& strCmdLine) 72 58 { 73 #ifndef ORXONOX_USE_WINMAIN 74 std::string strCmdLine; 75 for (int i = 1; i < argc; ++i) 76 strCmdLine += argv[i] + std::string(" "); 77 #endif 78 game = new Game(strCmdLine); 59 Game* game = new Game(strCmdLine); 79 60 80 61 game->setStateHierarchy( … … 108 89 else 109 90 Game::getInstance().requestStates("graphics, mainMenu"); 91 92 game->run(); 93 delete game; 94 95 return 0; 110 96 } 111 catch (const std::exception& ex)112 {113 COUT(0) << "Orxonox failed to initialise: " << ex.what() << std::endl;114 COUT(0) << "Terminating program." << std::endl;115 return 1;116 }117 catch (...)118 {119 COUT(0) << "Orxonox failed to initialise: " << std::endl;120 COUT(0) << "Terminating program." << std::endl;121 return 1;122 }123 124 game->run();125 delete game;126 127 return 0;128 97 } -
code/branches/libraries/src/orxonox/OrxonoxPrereqs.h
r3370 r5613 40 40 // Shared library settings 41 41 //----------------------------------------------------------------------- 42 #define ORXONOX_NO_EXPORTS // This is an executable that needs no exports 43 #if defined(ORXONOX_PLATFORM_WINDOWS) && !(defined(ORXONOX_STATIC_BUILD) || defined(ORXONOX_NO_EXPORTS)) 42 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD) 44 43 # ifdef ORXONOX_SHARED_BUILD 45 44 # define _OrxonoxExport __declspec(dllexport)
Note: See TracChangeset
for help on using the changeset viewer.