Browse Source

Default to RelWithDebInfo build on GCC. Removed Urho3D executable name debug postfix due to CMake limitations. Copy the executables to Bin directory similarly on both MSVC & GCC.

Lasse Öörni 14 years ago
parent
commit
c64e0cd165
5 changed files with 12 additions and 13 deletions
  1. 3 3
      CMakeLists.txt
  2. 2 2
      Docs/GettingStarted.dox
  3. 6 6
      Readme.txt
  4. 0 1
      Urho3D/CMakeLists.txt
  5. 1 1
      cmake_gcc.sh

+ 3 - 3
CMakeLists.txt

@@ -49,7 +49,6 @@ if (MSVC)
 else ()
     set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -m32")
-    set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/Bin)
 endif ()
 
 # Macro for precompiled headers
@@ -72,8 +71,9 @@ macro (finalize_exe)
     if (MSVC)
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETPATH) ${PROJECT_BINARY_DIR}/Bin)
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETDIR)$(TARGETNAME).pdb ${PROJECT_BINARY_DIR}/Bin)
-    else ()
-        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND strip ARGS ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}${CMAKE_EXECUTABLE_SUFFIX})
+    else ()
+        get_target_property (EXECUTABLE_NAME ${TARGET_NAME} LOCATION)
+        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EXECUTABLE_NAME} ${PROJECT_BINARY_DIR}/Bin)
     endif ()
 endmacro ()
 

+ 2 - 2
Docs/GettingStarted.dox

@@ -18,13 +18,13 @@ Urho3D uses CMake (http://www.cmake.org) to build. The process has two steps:
 
 1) Run CMake in the root directory with your preferred toolchain specified to generate the build files. You can use the batch files or shell scripts provided: cmake_vs2008.bat or cmake_vs2010.bat on Windows, and cmake_gcc.sh on Linux and Mac OS X.
 
-2) For Visual Studio, open Urho3D.sln and build the configuration(s) you like. For gcc, execute make (by default, cmake_gcc.sh specifies to make a Release build.)
+2) For Visual Studio, open Urho3D.sln and build the configuration(s) you like. For gcc, execute make (by default, cmake_gcc.sh specifies to make a RelWithDebInfo build.)
 
 The build process will also compile models and shaders from the Source_Asset directory into Bin/Data/Models & Bin/Data/Shaders. After the build is complete, the programs can be run from the Bin directory.
 
 When using Xcode on Mac OS X, select Project -> %Set Active Architecture -> i386 before building. Compiling Urho3D as 64-bit is not supported.
 
-To run Urho3D from the Visual Studio debugger, set it as a startup project and enter its relative path and filename into Properties -> Debugging -> Command: ..\Bin\Urho3D.exe or ..\Bin\Urho3D_d.exe. Additionally, entering -w into Debugging -> Command Arguments is highly recommended. This enables startup in windowed mode: without it running into an exception or breakpoint will be obnoxious as the mouse cursor will most probably be hidden.
+To run Urho3D from the Visual Studio debugger, set it as a startup project and enter its relative path and filename into Properties -> Debugging -> Command: ..\Bin\Urho3D.exe. Additionally, entering -w into Debugging -> Command Arguments is highly recommended. This enables startup in windowed mode: without it running into an exception or breakpoint will be obnoxious as the mouse cursor will likely be hidden.
 
 To actually make Urho3D.exe do something useful, it must be supplied with the name of the script file it should load and run. You can try for example the following arguments: Scripts/TestScene.as -w
 

+ 6 - 6
Readme.txt

@@ -100,8 +100,8 @@ cmake_vs2008.bat or cmake_vs2010.bat on Windows, and cmake_gcc.sh on Linux and
 Mac OS X.
 
 2) For Visual Studio, open Urho3D.sln and build the configuration(s) you like.
-For gcc, execute make (by default, cmake_gcc.sh specifies to make a Release
-build.)
+For gcc, execute make (by default, cmake_gcc.sh specifies to make a 
+RelWithDebInfo build.)
 
 The build process will also compile models and shaders from the Source_Asset
 directory into Bin/Data/Models & Bin/Data/Shaders. On Windows & Direct3D9,
@@ -115,10 +115,10 @@ After the build is complete, the programs can be run from the Bin directory.
 
 To run Urho3D from the Visual Studio debugger, set it as a startup project and
 enter its relative path and filename into Properties -> Debugging -> Command:
-..\Bin\Urho3D.exe or ..\Bin\Urho3D_d.exe. Additionally, entering -w into
-Debugging -> Command Arguments is highly recommended. This enables startup in
-windowed mode: without it running into an exception or breakpoint will be
-obnoxious as the mouse cursor will most probably be hidden.
+..\Bin\Urho3D.exe. Additionally, entering -w into Debugging -> Command 
+Arguments is highly recommended. This enables startup in windowed mode: 
+without it running into an exception or breakpoint will be obnoxious as the 
+mouse cursor will likely be hidden.
 
 To actually make Urho3D.exe do something useful, it must be supplied with the
 name of the script file it should load and run. You can try for example the

+ 0 - 1
Urho3D/CMakeLists.txt

@@ -19,6 +19,5 @@ else ()
     add_executable (${TARGET_NAME} ${SOURCE_FILES})
 endif ()
 
-set_target_properties (${TARGET_NAME} PROPERTIES DEBUG_POSTFIX _d)
 target_link_libraries (${TARGET_NAME} Container Core Engine IO Math Resource Script ${DBGHELP_LIB})
 finalize_exe ()

+ 1 - 1
cmake_gcc.sh

@@ -1 +1 @@
-cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
+cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo