Browse Source

Adjust batch files and shell scripts to take build tree as user input.
Refactor to use a single generic batch file/shell script that does the actual work.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
514847fb99

+ 42 - 25
.bash_helpers.sh

@@ -21,14 +21,10 @@
 #
 #
 
 
 # Define helpers
 # Define helpers
-msg() {
-    echo -e "\n$1\n================================================================================"
-}
-
 post_cmake() {
 post_cmake() {
-    if [ $GENERATOR == "Eclipse CDT4 - Unix Makefiles" ]; then
+    if [ $ECLIPSE ]; then
         # Integrate Urho3D documentation into Eclipse IDE
         # Integrate Urho3D documentation into Eclipse IDE
-        ln -snf $(pwd)/Docs/html ~/.eclipse/$(ls -1t ~/.eclipse |grep org.eclipse.platform_ |head -1)/plugins
+        ln -snf $SOURCE/Docs/html ~/.eclipse/$(ls -1t ~/.eclipse |grep org.eclipse.platform_ |head -1)/plugins
 
 
         # Check if xmlstarlet software package is available for fixing the generated Eclipse project setting
         # Check if xmlstarlet software package is available for fixing the generated Eclipse project setting
         if [ $HAS_XMLSTARLET ]; then
         if [ $HAS_XMLSTARLET ]; then
@@ -40,13 +36,13 @@ post_cmake() {
             xmlstarlet ed -P -L \
             xmlstarlet ed -P -L \
                 -u "/projectDescription/name/text()" -x "concat(substring-before(., '-Release'), substring-before(., '-Debug'), substring-before(., '-RelWithDebInfo'))" \
                 -u "/projectDescription/name/text()" -x "concat(substring-before(., '-Release'), substring-before(., '-Debug'), substring-before(., '-RelWithDebInfo'))" \
                 -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.core.errorOutputParser']" -x "concat('org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;', substring-after(., 'org.eclipse.cdt.core.MakeErrorParser'))" \
                 -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.core.errorOutputParser']" -x "concat('org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;', substring-after(., 'org.eclipse.cdt.core.MakeErrorParser'))" \
-                $1/.project
+                $BUILD/.project
 
 
             # Build-specific fixes
             # Build-specific fixes
-            if [ $1 == "android-Build" ]; then
+            if [ $ANDROID ]; then
                 # For Android build, add the Android and Java nature to the project setting as it would be done by Eclipse during project import
                 # For Android build, add the Android and Java nature to the project setting as it would be done by Eclipse during project import
-                # This fix avoids the step to reimport the project everytime the Eclipse project setting is regenerated by cmake_gcc.sh invocation
-                echo -- Add Android and Java nature to Eclipse project setting files in $( pwd )/$1
+                # This fix avoids the step to reimport the project everytime the Eclipse project setting is regenerated by cmake_generic.sh invocation
+                echo -- Add Android and Java nature to Eclipse project setting files in $BUILD
 
 
                 #
                 #
                 # Add natures (Android nature must be inserted as first nature)
                 # Add natures (Android nature must be inserted as first nature)
@@ -54,7 +50,7 @@ post_cmake() {
                 xmlstarlet ed -P -L \
                 xmlstarlet ed -P -L \
                     -i "/projectDescription/natures/nature[1]" -t elem -n nature -v "com.android.ide.eclipse.adt.AndroidNature" \
                     -i "/projectDescription/natures/nature[1]" -t elem -n nature -v "com.android.ide.eclipse.adt.AndroidNature" \
                     -s "/projectDescription/natures" -t elem -n nature -v "org.eclipse.jdt.core.javanature" \
                     -s "/projectDescription/natures" -t elem -n nature -v "org.eclipse.jdt.core.javanature" \
-                    $1/.project
+                    $BUILD/.project
                 #
                 #
                 # Add build commands
                 # Add build commands
                 #
                 #
@@ -64,23 +60,23 @@ post_cmake() {
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n name -v $c \
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n name -v $c \
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n arguments -v "" \
                         -s "/projectDescription/buildSpec/buildCommandNew" -t elem -n arguments -v "" \
                         -r "/projectDescription/buildSpec/buildCommandNew" -v "buildCommand" \
                         -r "/projectDescription/buildSpec/buildCommandNew" -v "buildCommand" \
-                        $1/.project
+                        $BUILD/.project
                 done
                 done
 
 
-            elif [ $1 == "raspi-Build" ]; then
-                # For Raspberry Pi build, add [Bin-CC] linked resource
+            elif [ $RASPI ]; then
+                # For Raspberry Pi build, add [Bin] linked resource
                 #
                 #
-                # Replace [Subprojects]/Urho3D linked resource to [Targets]/[Bin-CC] instead
+                # Replace [Subprojects]/Urho3D linked resource to [Targets]/[Bin] instead
                 #
                 #
                 xmlstarlet ed -P -L \
                 xmlstarlet ed -P -L \
-                    -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Targets]/[Bin-CC]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Targets]/[Bin-CC]']" -v "$( pwd )/Bin-CC" \
-                    $1/.project
+                    -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Targets]/[Bin]" \
+                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Targets]/[Bin]']" -v "$BUILD/Bin" \
+                    $BUILD/.project
 
 
-            else
-                # For native build, move the Eclipse project setting files back to Source folder to fix source code versioning
-                echo -- Eclipse project setting files have been relocated to: $( pwd )/Source
-                for f in .project .cproject; do mv $1/$f Source; done
+            elif [ $FIX_SCM ] && [ ! $IOS ] && [ ! $WINDOWS ]; then
+                # For native build, move the Eclipse project setting files back to Source tree in order to make Eclipse's SCM feature works
+                echo -- Eclipse project setting files have been relocated to: $SOURCE
+                for f in .project .cproject; do mv $BUILD/$f $SOURCE; done
 
 
                 #
                 #
                 # Replace [Source directory] linked resource to [Build] instead
                 # Replace [Source directory] linked resource to [Build] instead
@@ -89,10 +85,10 @@ post_cmake() {
                 #
                 #
                 xmlstarlet ed -P -L \
                 xmlstarlet ed -P -L \
                     -u "/projectDescription/linkedResources/link/name/text()[. = '[Source directory]']" -v "[Build]" \
                     -u "/projectDescription/linkedResources/link/name/text()[. = '[Source directory]']" -v "[Build]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]']" -v "$( pwd )/$1" \
-                    -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.make.core.build.arguments']" -x "concat('-C ../$1 ', .)" \
+                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]']" -v "$BUILD" \
+                    -u "/projectDescription/buildSpec/buildCommand/arguments/dictionary/value[../key/text() = 'org.eclipse.cdt.make.core.build.arguments']" -x "concat('-C $BUILD ', .)" \
                     -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Build]/[Bin]" \
                     -u "/projectDescription/linkedResources/link/name/text()[. = '[Subprojects]/Urho3D']" -v "[Build]/[Bin]" \
-                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]/[Bin]']" -v "$( pwd )/Bin" \
+                    -u "/projectDescription/linkedResources/link/location[../name/text() = '[Build]/[Bin]']" -v "$BUILD/Bin" \
                     Source/.project
                     Source/.project
                 #
                 #
                 # Fix source path entry to Source folder and modify its filter condition
                 # Fix source path entry to Source folder and modify its filter condition
@@ -106,6 +102,27 @@ post_cmake() {
                     Source/.cproject
                     Source/.cproject
             fi
             fi
         fi
         fi
+    elif [ $IOS ]; then
+        # Temporary fix: can be removed when CMake minimum required has reached 2.8.12
+        if [ -e $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make ]; then
+            # Due to a bug in the CMake/Xcode generator (prior to version 2.8.12) where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
+            # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
+            # Since version 2.8.12 CMake does not generate XCODE_DEPEND_HELPER.make script anymore, so we skip this fix when the script does not exist
+            sed -i '' 's/\/Contents\/MacOS//g' $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make
+        fi
+
+        # Temporary fix: known CMake bug (still exists in 2.8.12)
+        if [ -e $BUILD/CMakeScripts/install_postBuildPhase.makeDebug ]; then
+            # Due to a bug in the CMake/Xcode generator that prevents iOS targets (library and bundle) to be installed correctly
+            # (see http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency),
+            # below temporary fix is required to work around the bug
+            sed -i '' 's/$(EFFECTIVE_PLATFORM_NAME)//g' $BUILD/CMakeScripts/install_postBuildPhase.make*
+        fi
+
+        # Set Xcode build settings to skip dSYM file generation for Debug configuration (other configurations still use the default dwarf-with-dsym)
+        if [ -e $BUILD/*.xcodeproj/project.pbxproj ] && perl -v >/dev/null 2>&1; then
+            perl -i -pe 'BEGIN {$/=undef} s/(Begin XCBuildConfiguration.*?Debug.*?Settings = {\n)/\1DEBUG_INFORMATION_FORMAT = dwarf;\n/s' $BUILD/*.xcodeproj/project.pbxproj
+        fi
     fi
     fi
 }
 }
 
 

+ 10 - 16
.gitignore

@@ -1,7 +1,3 @@
-# Build directories
-Build/
-*-Build/
-
 # Output directories
 # Output directories
 Bin/*
 Bin/*
 !Bin/**/
 !Bin/**/
@@ -11,9 +7,7 @@ Bin/*.app/
 Bin/*.app.dSYM/
 Bin/*.app.dSYM/
 Bin/Data/LuaScripts/jit/
 Bin/Data/LuaScripts/jit/
 Bin/Screenshots
 Bin/Screenshots
-*-Bin/
 Lib/
 Lib/
-*-Lib/
 
 
 # Compiled shaders
 # Compiled shaders
 *.vs2
 *.vs2
@@ -43,17 +37,17 @@ Source/.settings
 # Qt Creator project settings
 # Qt Creator project settings
 Source/CMakeLists.txt.user
 Source/CMakeLists.txt.user
 
 
-# Android in-the-source project settings
-Source/Android/project.properties
-Source/Android/local.properties
-Source/Android/proguard-project.txt
+# Android non out-of-source project settings
+Android/project.properties
+Android/local.properties
+Android/proguard-project.txt
 
 
-# Android in-the-source build and output directories
-Source/Android/Engine
-Source/Android/ThirdParty
-Source/Android/libs
+# Android non out-of-source build and output directories
+Android/Engine
+Android/ThirdParty
+Android/libs
 
 
-# Android in-the-source CMake build files
+# Non out-of-source CMake generated build files
 CMakeCache.txt
 CMakeCache.txt
 CMakeFiles/
 CMakeFiles/
 CMakeScripts/
 CMakeScripts/
@@ -61,7 +55,7 @@ Makefile
 cmake_install.cmake
 cmake_install.cmake
 install_manifest.txt
 install_manifest.txt
 
 
-# GCC PCH files that are some-how ending up in the Source tree instead of the Build directory
+# GCC PCH files
 *.gch
 *.gch
 
 
 # Misc.
 # Misc.

+ 1 - 1
CMake/Modules/FindUrho3D.cmake

@@ -87,7 +87,7 @@ if (URHO3D_HOME)
         if (IS_INTERNAL)
         if (IS_INTERNAL)
             set (BINARY_DIR ${CMAKE_BINARY_DIR})
             set (BINARY_DIR ${CMAKE_BINARY_DIR})
         elseif (ANDROID AND CMAKE_HOST_WIN32 AND NOT URHO3D_MKLINK)
         elseif (ANDROID AND CMAKE_HOST_WIN32 AND NOT URHO3D_MKLINK)
-            set (BINARY_DIR ${URHO3D_HOME}/Source/Android)
+            set (BINARY_DIR ${URHO3D_HOME}/Android)
         else ()
         else ()
             set (BINARY_DIR ${URHO3D_HOME}/${PLATFORM_PREFIX}Build)
             set (BINARY_DIR ${URHO3D_HOME}/${PLATFORM_PREFIX}Build)
         endif () 
         endif () 

+ 63 - 24
CMake/Modules/Urho3D-CMake-common.cmake

@@ -48,10 +48,11 @@ if (NOT MSVC AND NOT DEFINED URHO3D_DEFAULT_64BIT)  # Only do this once in the i
     execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
     execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
     string (REGEX MATCH "#define +__(x86_64|aarch64)__ +1" matched "${PREDEFINED_MACROS}")
     string (REGEX MATCH "#define +__(x86_64|aarch64)__ +1" matched "${PREDEFINED_MACROS}")
     if (matched)
     if (matched)
-        set (URHO3D_DEFAULT_64BIT TRUE CACHE INTERNAL "Default value for URHO3D_64BIT build option")
+        set (URHO3D_DEFAULT_64BIT TRUE)
     else ()
     else ()
-        set (URHO3D_DEFAULT_64BIT FALSE CACHE INTERNAL "Default value for URHO3D_64BIT build option")
+        set (URHO3D_DEFAULT_64BIT FALSE)
     endif ()
     endif ()
+    set (URHO3D_DEFAULT_64BIT ${URHO3D_DEFAULT_64BIT} CACHE INTERNAL "Default value for URHO3D_64BIT build option")
     # The 'ANDROID' CMake variable is already set by android.toolchain.cmake when it is being used for cross-compiling Android
     # The 'ANDROID' CMake variable is already set by android.toolchain.cmake when it is being used for cross-compiling Android
     # The other arm platform that Urho3D supports that is not Android is Raspberry Pi at the moment
     # The other arm platform that Urho3D supports that is not Android is Raspberry Pi at the moment
     if (NOT ANDROID)
     if (NOT ANDROID)
@@ -116,7 +117,17 @@ elseif (WIN32)
     # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
     # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
     option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" TRUE)
     option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" TRUE)
 endif ()
 endif ()
-cmake_dependent_option (URHO3D_MKLINK "Use mklink command to create symbolic links (Windows Vista and above only)" FALSE "CMAKE_HOST_WIN32" FALSE)
+if (CMAKE_HOST_WIN32 AND NOT DEFINED URHO3D_MKLINK)
+    # Test whether the host system is capable of setting up symbolic link
+    execute_process (COMMAND mklink test-link CMakeCache.txt RESULT_VARIABLE MKLINK_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+    if (MKLINK_EXIT_CODE EQUAL 0)
+        set (URHO3D_MKLINK TRUE)
+        file (REMOVE test-link)
+    else ()
+        set (URHO3D_MKLINK FALSE)
+    endif ()
+    set (URHO3D_MKLINK ${URHO3D_MKLINK} CACHE INTERNAL "MKLINK capability on the Windows host system")
+endif ()
 cmake_dependent_option (URHO3D_STATIC_RUNTIME "Use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)" FALSE "MSVC" FALSE)
 cmake_dependent_option (URHO3D_STATIC_RUNTIME "Use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)" FALSE "MSVC" FALSE)
 set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
 set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
 if (CMAKE_CROSSCOMPILING AND NOT ANDROID)
 if (CMAKE_CROSSCOMPILING AND NOT ANDROID)
@@ -129,10 +140,6 @@ if (ANDROID)
     cmake_dependent_option (ANDROID_NDK_GDB "Enable ndk-gdb for debugging (Android build only)" FALSE "CMAKE_BUILD_TYPE STREQUAL Debug" FALSE)
     cmake_dependent_option (ANDROID_NDK_GDB "Enable ndk-gdb for debugging (Android build only)" FALSE "CMAKE_BUILD_TYPE STREQUAL Debug" FALSE)
 else ()
 else ()
     unset (ANDROID_NDK_GDB CACHE)
     unset (ANDROID_NDK_GDB CACHE)
-    if (ANDROID_ABI AND ANDROID_NATIVE_API_LEVEL)
-        # Just reference it to suppress "unused variable" CMake warning on non-Android project
-        # Due to the design of cmake_gcc.sh currently, the script can be used to configure/generate Android project and other non-Android projects in one go
-    endif ()
 endif ()
 endif ()
 # Constrain the build option values in cmake-gui, if applicable
 # Constrain the build option values in cmake-gui, if applicable
 if (CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
 if (CMAKE_VERSION VERSION_GREATER 2.8 OR CMAKE_VERSION VERSION_EQUAL 2.8)
@@ -379,7 +386,7 @@ macro (set_output_directories OUTPUT_PATH)
     endforeach ()
     endforeach ()
 endmacro ()
 endmacro ()
 
 
-# Set common binary output directory for all targets
+# Set common binary output directory for all platforms
 if (IOS)
 if (IOS)
     set (PLATFORM_PREFIX ios-)
     set (PLATFORM_PREFIX ios-)
 elseif (CMAKE_CROSSCOMPILING)
 elseif (CMAKE_CROSSCOMPILING)
@@ -393,24 +400,56 @@ elseif (CMAKE_CROSSCOMPILING)
 endif ()
 endif ()
 set_output_directories (${PROJECT_ROOT_DIR}/${PLATFORM_PREFIX}Bin RUNTIME PDB)
 set_output_directories (${PROJECT_ROOT_DIR}/${PLATFORM_PREFIX}Bin RUNTIME PDB)
 
 
-# Enable Android ndk-gdb
-if (ANDROID_NDK_GDB)
-    set (NDK_GDB_SOLIB_PATH ${PROJECT_BINARY_DIR}/obj/local/${ANDROID_NDK_ABI_NAME}/)
-    file (MAKE_DIRECTORY ${NDK_GDB_SOLIB_PATH})
-    set (NDK_GDB_JNI ${PROJECT_BINARY_DIR}/jni)
-    set (NDK_GDB_MK "# This is a generated file. DO NOT EDIT!\n\nAPP_ABI := ${ANDROID_NDK_ABI_NAME}\n")
-    foreach (MK Android.mk Application.mk)
-        if (NOT EXISTS ${NDK_GDB_JNI}/${MK})
-            file (WRITE ${NDK_GDB_JNI}/${MK} ${NDK_GDB_MK})
+# Macro for setting symbolic link on platform that supports it
+macro (create_symlink SOURCE DESTINATION)
+    if (CMAKE_HOST_WIN32)
+        if (URHO3D_MKLINK)
+            if (NOT EXISTS  ${DESTINATION})
+                if (IS_DIRECTORY ${SOURCE})
+                    set (MKLINK_OPT /D)
+                else ()
+                    unset (MKLINK_OPT)
+                endif ()
+                execute_process (COMMAND mklink ${MKLINK_OPT} "${DESTINATION}" "${SOURCE}")
+            endif ()
+        else ()
+            message (WARNING "Unable to create symbolic link on this host system, you may need to manually copy file/dir from \"${SOURCE}\" to \"${DESTINATION}\"")
+        endif ()
+    else ()
+        execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink "${SOURCE}" "${DESTINATION}")
+    endif ()
+endmacro ()
+
+# Set common project structure for Android platform
+if (ANDROID)
+    # Enable Android ndk-gdb
+    if (ANDROID_NDK_GDB)
+        set (NDK_GDB_SOLIB_PATH ${CMAKE_BINARY_DIR}/obj/local/${ANDROID_NDK_ABI_NAME}/)
+        file (MAKE_DIRECTORY ${NDK_GDB_SOLIB_PATH})
+        set (NDK_GDB_JNI ${CMAKE_BINARY_DIR}/jni)
+        set (NDK_GDB_MK "# This is a generated file. DO NOT EDIT!\n\nAPP_ABI := ${ANDROID_NDK_ABI_NAME}\n")
+        foreach (MK Android.mk Application.mk)
+            if (NOT EXISTS ${NDK_GDB_JNI}/${MK})
+                file (WRITE ${NDK_GDB_JNI}/${MK} ${NDK_GDB_MK})
+            endif ()
+        endforeach ()
+        get_directory_property (INCLUDE_DIRECTORIES DIRECTORY ${PROJECT_SOURCE_DIR} INCLUDE_DIRECTORIES)
+        string (REPLACE ";" " " INCLUDE_DIRECTORIES "${INCLUDE_DIRECTORIES}")   # Note: need to always "stringify" a variable in list context for replace to work correctly
+        set (NDK_GDB_SETUP "# This is a generated file. DO NOT EDIT!\n\nset solib-search-path ${NDK_GDB_SOLIB_PATH}\ndirectory ${INCLUDE_DIRECTORIES}\n")
+        file (WRITE ${ANDROID_LIBRARY_OUTPUT_PATH}/gdb.setup ${NDK_GDB_SETUP})
+        file (COPY ${ANDROID_NDK}/prebuilt/android-${ANDROID_ARCH_NAME}/gdbserver/gdbserver DESTINATION ${ANDROID_LIBRARY_OUTPUT_PATH})
+    else ()
+        file (REMOVE ${ANDROID_LIBRARY_OUTPUT_PATH}/gdbserver)
+    endif ()
+    # Create symbolic links in the build tree
+    foreach (I CoreData Data)
+        create_symlink (../../Bin/${I} Android/assets/${I})
+    endforeach ()
+    foreach (I AndroidManifest.xml build.xml src res assets jni)
+        if (EXISTS Android/${I})
+            create_symlink (${CMAKE_SOURCE_DIR}/Android/${I} ${CMAKE_BINARY_DIR}/${I})
         endif ()
         endif ()
     endforeach ()
     endforeach ()
-    get_directory_property (INCLUDE_DIRECTORIES DIRECTORY ${PROJECT_SOURCE_DIR} INCLUDE_DIRECTORIES)
-    string (REPLACE ";" " " INCLUDE_DIRECTORIES "${INCLUDE_DIRECTORIES}")   # Note: need to always "stringify" a variable in list context for replace to work correctly
-    set (NDK_GDB_SETUP "# This is a generated file. DO NOT EDIT!\n\nset solib-search-path ${NDK_GDB_SOLIB_PATH}\ndirectory ${INCLUDE_DIRECTORIES}\n")
-    file (WRITE ${ANDROID_LIBRARY_OUTPUT_PATH}/gdb.setup ${NDK_GDB_SETUP})
-    file (COPY ${ANDROID_NDK}/prebuilt/android-${ANDROID_ARCH_NAME}/gdbserver/gdbserver DESTINATION ${ANDROID_LIBRARY_OUTPUT_PATH})
-elseif (ANDROID)
-    file (REMOVE ${ANDROID_LIBRARY_OUTPUT_PATH}/gdbserver)
 endif ()
 endif ()
 
 
 # Override builtin macro and function to suit our need, always generate header file regardless of target type...
 # Override builtin macro and function to suit our need, always generate header file regardless of target type...

+ 40 - 63
Docs/GettingStarted.dox

@@ -12,7 +12,7 @@ Although all required third-party libraries are included as source code, there a
 
 
 - For Linux, the following development packages need to be installed: libx11-dev, libxrandr-dev, libasound2-dev on Debian-based distros; libX11-devel, libXrandr-devel, alsa-lib-devel on RedHat-based distros. Also install the package libgl1-mesa-dev (Debian) or mesa-libGL-devel (RH) if your GPU driver does not include OpenGL headers & libs.  Building as 32-bit on a 64-bit system requires installing also the 32-bit versions of the development libraries.
 - For Linux, the following development packages need to be installed: libx11-dev, libxrandr-dev, libasound2-dev on Debian-based distros; libX11-devel, libXrandr-devel, alsa-lib-devel on RedHat-based distros. Also install the package libgl1-mesa-dev (Debian) or mesa-libGL-devel (RH) if your GPU driver does not include OpenGL headers & libs.  Building as 32-bit on a 64-bit system requires installing also the 32-bit versions of the development libraries.
 
 
-- For Raspberry Pi, the following development packages need to be installed: libraspberrypi0, libraspberrypi-dev, libasound2-dev, libudev-dev on Raspbian; raspberrypi-vc-libs, raspberrypi-vc-libs-devel, alsa-lib-devel, systemd-devel on Pidora. The first two packages which contain the Broadcom VideoCore IV libraries and development headers should normally come preinstalled.
+- For Raspberry Pi, the following development packages need to be installed. On Raspbian: libasound2-dev, libudev-dev. On Pidora: alsa-lib-devel, systemd-devel.
 
 
 - For Mac OS X, the Xcode developer tools package should include everything necessary.
 - For Mac OS X, the Xcode developer tools package should include everything necessary.
 
 
@@ -24,7 +24,7 @@ To run Urho3D, the minimum system requirements are:
 
 
 - Linux & Mac OS X: CPU with SSE instructions support, GPU with OpenGL 2.0 support, EXT_framebuffer_object and EXT_packed_depth_stencil extensions.
 - Linux & Mac OS X: CPU with SSE instructions support, GPU with OpenGL 2.0 support, EXT_framebuffer_object and EXT_packed_depth_stencil extensions.
 
 
-- Raspberry Pi: %Model B revision 2.0 with at least 128 MB of 512 MB SDRAM allocated for GPU. OpenGL ES 2.0 capable GPU.
+- Raspberry Pi: %Model B revision 2.0 with at least 128 MB of 512 MB SDRAM allocated for GPU.
 
 
 - Android: OS version 2.3 or newer, OpenGL ES 2.0 capable GPU.
 - Android: OS version 2.3 or newer, OpenGL ES 2.0 capable GPU.
 
 
@@ -32,26 +32,25 @@ To run Urho3D, the minimum system requirements are:
 
 
 SSE requirement can be eliminated by disabling the use of SSE instruction set, see \ref Build_Options "Build options" below.
 SSE requirement can be eliminated by disabling the use of SSE instruction set, see \ref Build_Options "Build options" below.
 
 
-\section Building_Desktop Desktop build process
+\section Building_Native Native build process
 
 
 Urho3D uses CMake (http://www.cmake.org) to build. The process has two steps:
 Urho3D uses CMake (http://www.cmake.org) to build. The process has two steps:
 
 
--# Run CMake in the root directory with your preferred toolchain specified to generate the build files. You can use the provided batch files or shell scripts on the respective platform.\n
-    - Windows: cmake_vs2008.bat, cmake_vs2010.bat, cmake_vs2012.bat, or cmake_mingw.bat,\n
-    - Linux: cmake_gcc.sh, cmake_eclipse.sh, or cmake_codeblocks.sh\n
-    - Mac OS X: cmake_gcc.sh or cmake_macosx.sh.\n
--# Open the CMake's generated project file in the IDE of your choice. Change the build configuration (Debug/Release) and then build all the targets.\n
-    - Visual Studio: open Urho3D.sln from the Build directory.\n
+-# Run CMake in the root directory (which is also CMake's source tree) with your preferred generator and toolchain specified to generate the build tree. You can use cmake-gui or the provided batch files or shell scripts on the respective host system. All the batch files and shell scripts expect the build tree location to be passed as the first argument, or to execute them in the build tree itself when reconfiguring the existing build tree.\n
+    - Windows: cmake_vs2008.bat, cmake_vs2010.bat, cmake_vs2012.bat, cmake_vs2013.bat, or cmake_mingw.bat,\n
+    - Linux: cmake_generic.sh, cmake_eclipse.sh, or cmake_codeblocks.sh\n
+    - Mac OS X: cmake_generic.sh or cmake_macosx.sh.\n
+-# Use the IDE of your choice to open the CMake's generated project file or solution file in the build tree. Change the build configuration (Debug/Release) and then build all the targets.\n
+    - Visual Studio: open Urho3D.sln.\n
     - Xcode: open Urho3D.xcodeproj.\n
     - Xcode: open Urho3D.xcodeproj.\n
     - CodeBlocks: open Urho3D.cbp.\n
     - CodeBlocks: open Urho3D.cbp.\n
     - Eclipse: import project using File|Import "Existing Projects into Workspace".\n
     - Eclipse: import project using File|Import "Existing Projects into Workspace".\n
-    - GCC: execute make from the Build directory in a terminal/console.
 
 
-Note that Eclipse requires CDT plugin to build C/C++ project.
+Note that Eclipse requires CDT plugin to build C/C++ project. When using generator backed by Unix Makefiles, you can also execute make command directly in the build tree to build the project.
 
 
-If using MinGW to compile, DirectX headers may need to be acquired separately. They can be copied to the MinGW installation eg. from the following package: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz These will be missing some of the headers related to shader compilation, so a MinGW build will use OpenGL by default. To build in Direct3D9 mode, the MinGW-w64 port is necessary: http://mingw-w64.sourceforge.net/ Using it, Direct3D9 can be enabled with the CMake option -DURHO3D_OPENGL=0.
+If using MinGW to compile, DirectX headers may need to be acquired separately. They can be copied to the MinGW installation eg. from the following package: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz These will be missing some of the headers related to shader compilation, so a MinGW build will use OpenGL by default. To build in Direct3D9 mode, the MinGW-w64 port is necessary: http://mingw-w64.sourceforge.net/. Using it, Direct3D9 can be enabled with the "-DURHO3D_OPENGL=0" build option.
 
 
-After the build is complete, the programs can be run from the Bin directory. These include the Urho3D player application, which can run application scripts, the tools, and C++ sample applications if they have been enabled.
+After the build is complete, the programs can be run from the Bin subdirectory in the build tree. These include the Urho3D player application, which can run application scripts, the tools, and C++ sample applications if they have been enabled.
 
 
 To run the Urho3D player application from the Visual Studio debugger, set the Urho3DPlayer project as the startup project and enter its relative path and filename into Properties -> Debugging -> Command: ../../../Bin/Urho3DPlayer.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 the Urho3DPlayer application 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/NinjaSnowWar.as -w
 To run the Urho3D player application from the Visual Studio debugger, set the Urho3DPlayer project as the startup project and enter its relative path and filename into Properties -> Debugging -> Command: ../../../Bin/Urho3DPlayer.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 the Urho3DPlayer application 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/NinjaSnowWar.as -w
 
 
@@ -59,31 +58,29 @@ To run from Eclipse on Linux, locate and select the Urho3DPlayer executable in t
 
 
 To run from Xcode on Mac OS X, edit the Product Scheme to set "Run" setting to execute "Urho3DPlayer" in the "Info" tab. In the "Arguments" tab, specify the arguments required by Urho3DPlayer executable. Ensure the check boxes are ticked on the argument entries that you want to be active.
 To run from Xcode on Mac OS X, edit the Product Scheme to set "Run" setting to execute "Urho3DPlayer" in the "Info" tab. In the "Arguments" tab, specify the arguments required by Urho3DPlayer executable. Ensure the check boxes are ticked on the argument entries that you want to be active.
 
 
-CMake caches some internal variables to speed up the subsequent invocation of the CMake build script. This is normally a good thing. However, there are cases when this is not desirable, for instance when switching CMake generators or after upgrading development software components. In such cases, it is recomended to first clean the CMake cache by invoking cmake_clean.bat or cmake_clean.sh.
+CMake caches some internal variables to speed up the subsequent invocation of the CMake. This is normally a good thing. However, there are cases when this is not desirable, for instance when switching CMake generators or after upgrading development software components. In such cases, it is recomended to first clean the CMake cache by invoking cmake_clean.bat or cmake_clean.sh by passing the location of the build tree to one of these as the first argument or by executing it in the build tree itself.
 
 
 \section Building_Android Android build process
 \section Building_Android Android build process
 
 
-First, if you are building under Windows host without MKLINK support then copy Bin/Data and Bin/CoreData directories to the Source/Android/assets directory (you can use the provided batch file CopyData.bat). This step is not necessary for Windows with MKLINK support and non-Windows host because the build script uses symbolic links for host development environments that support it.
+First, if you are building under Windows host without MKLINK support then copy Bin/Data and Bin/CoreData directories to the Android/assets directory (you can use the provided batch file CopyData.bat). This step is not necessary for Windows host with MKLINK support and other non-Windows host systems.
 
 
 Set the ANDROID_NDK environment variable to point to your Android NDK. On Windows, ensure that make.exe from the Android NDK is included in the path and is executable from the command line.
 Set the ANDROID_NDK environment variable to point to your Android NDK. On Windows, ensure that make.exe from the Android NDK is included in the path and is executable from the command line.
 
 
-On Windows, execute cmake_android.bat. If your user account has privilege to use MKLINK then you have the option to provide the build option "-DURHO3D_MKLINK=1" when invoking the cmake_android.bat to generate out-of-source build tree. Then go to the build tree directory which could be either 'Source/Android' or 'android-Build' (when using MKLINK) and execute the below commands to start the build.
+On Windows host, execute cmake_android.bat. On OS X or Linux host, execute cmake_android.sh. Then go to the build tree and execute the below commands to start the build.
 
 
 - android update project -p . -t 1 (replace id to match the desired target API)
 - android update project -p . -t 1 (replace id to match the desired target API)
 - make -j8 (replace the number to match your host's number of logical CPU cores)
 - make -j8 (replace the number to match your host's number of logical CPU cores)
 - ant debug
 - ant debug
 
 
-On OS X or Linux, execute cmake_gcc.sh (the presence of ANDROID_NDK environment variable instructs the shell script to also generate project file for Android build besides normal desktop build). Then go to the build tree (which is currently defaulted to 'android-Build' directory) and execute the same commands as above.
-
-After the commands finish successfully, the APK should have been generated in the build tree's "bin" subdirectory, from where it can be installed on a device or an emulator. The command "ant installd" can be used for this. After the debug APK has been installed, you can use "rake android" command to automate the test running of the APK on the attached Android device.
+After the commands finish successfully, the APK should have been generated in the build tree's "bin" subdirectory, from where it can be installed on a device or an emulator. The command "ant installd" can be used for this. Optionally when you have Rake installed, after the debug APK has been installed then you can use "rake android" command to automate the test running of the APK on an attached Android (virtual) device.
 
 
 For a release build, use the "ant release" command instead of "ant debug" and follow the Android SDK instructions on how to sign your APK properly.
 For a release build, use the "ant release" command instead of "ant debug" and follow the Android SDK instructions on how to sign your APK properly.
 
 
 By default the Android package for Urho3D is com.googlecode.urho3d. For a real application you must replace this with your own package name. The Urho3D activity subclasses the SDLActivity from org.libsdl.app package, whose name (or the JNI code from SDL library) does not have to be changed.
 By default the Android package for Urho3D is com.googlecode.urho3d. For a real application you must replace this with your own package name. The Urho3D activity subclasses the SDLActivity from org.libsdl.app package, whose name (or the JNI code from SDL library) does not have to be changed.
 
 
-Note that the native code is built by default for armeabi-v7a ABI. To make your program compatible also with old Android devices, build also an armeabi version by executing the CMake batch file or shell script again with the build option "-DANDROID_ABI=armeabi" added, then execute make again in the build directory. Similarly, the native code can be built using 64-bit ABI by changing the value of this build option. See \ref Build_Options "Build options" for all the possible values.
+Note that the native code is built by default for armeabi-v7a ABI. To make your program compatible also with old Android devices, build also an armeabi version by reconfiguring the build tree again with the build option "-DANDROID_ABI=armeabi" added, then execute make again in the build directory. Similarly, the native code can be built using 64-bit ABI by changing the value of this build option. See \ref Build_Options "Build options" for all the possible values. Note that CMake doesn't allow changing of its compiler settings in an existing build tree, so before reconfiguring to use an incompatible ANDROID_ABI most likely you need to clean the CMake cache first.
 
 
-You can also build and deploy using Eclipse IDE with ADT plugin. To do that, after setting the ANDROID_NDK environment variable then run cmake_eclipse.sh instead of cmake_gcc.sh. Import "Existing Android Code into Workspace" from the CMake generated Eclipse project file in the build tree. Switch Eclipse IDE to use Java Perspective. Update project properties to choose the desired Android API target. Choose "Run" to let ADT automatically build and deploy the application to Android (virtual) device.
+You can also build and deploy using Eclipse IDE with ADT plugin. To do that, execute cmake_eclipse.sh with "-DANDROID=1" build option set. Import "Existing Android Code into Workspace" from the CMake generated Eclipse project file in the build tree. Switch Eclipse IDE to use Java Perspective. Update project properties to choose the desired Android API target. Choose "Run" to let ADT automatically build and deploy the application to Android (virtual) device.
 
 
 \section Building_Ios iOS build process
 \section Building_Ios iOS build process
 
 
@@ -97,34 +94,33 @@ To run from Xcode on iPhone/iPad Simulator, edit the Product Scheme to set "Run"
 
 
 \section Building_RaspberryPi Raspberry Pi build process
 \section Building_RaspberryPi Raspberry Pi build process
 
 
-For native build on Raspberry Pi itself, use the similar process for Linux Desktop build described above.
+For native build on Raspberry Pi itself, use the similar process for \ref Building_Native "Linux native build" described above.
 
 
-For cross-compiling build on another build/host machine, firstly set the RASPI_TOOL environment variable to point to your Raspberry Pi Cross-Compiling tool where all the arm-linux-gnueabihf-* executables are located. You can setup the tool using <a href="http://crosstool-ng.org/">crosstool-NG</a> or just download one from https://github.com/raspberrypi/tools. Secondly, set the RASPI_ROOT environment variable to point to your Raspbian or Pidora system root. You must install the Urho3D prerequisites software development packages for Raspberry Pi (see \ref Building_Prerequisites) in the system root before attempting to do the Urho3D cross-compiling build. You can download a Raspbian system root from
-https://github.com/urho3d/rpi-sysroot.
+For cross-compiling build on an Linux host system, firstly set the RASPI_TOOL environment variable to point to your Raspberry Pi Cross-Compiling tool where all the arm-linux-gnueabihf-* executables are located. You can setup the tool using <a href="http://crosstool-ng.org/">crosstool-NG</a> or just download one from https://github.com/raspberrypi/tools. Secondly, set the RASPI_ROOT environment variable to point to your Raspbian or Pidora system root. You must install the Urho3D prerequisites software development packages for Raspberry Pi (see \ref Building_Prerequisites) in the system root before attempting to do the Urho3D cross-compiling build. You are recommended to download the Raspbian system root with Urho3D prerequisite software installed from https://github.com/urho3d/rpi-sysroot. You can just download from the "strip" branch to cut down the download time and size.
 
 
-When running cmake_gcc.sh with RASPI_TOOL environment variable set, it tells build script to generate additional raspi-Build directory for cross-compiling. Go to this raspi-Build directory and proceed to execute make. After the build is complete, the ARM executables can be found in Bin-CC output directory.
+Execute cmake_raspi.sh then go to the build tree to execute make command. After the build is complete, the ARM executables can be found in the build tree's "Bin" subdirectory.
 
 
-You can also build, deploy, run/debug (as C/C++ Remote %Application) using Eclipse IDE, if you run cmake_eclipse.sh to generate the project file. Import the CMake generated Eclipse project in the raspi-Build directory into Eclipse's workspace. Build the project as usual. Use the URHO3D_SCP_TO_TARGET build option to automatically deploy the ARM executables to target Raspberry Pi as part of every project build or configure Eclipse to perform a "download to target path" in the Run/Debug configuration for C/C++ Remote %Application. Either way, you have to configure the Run/Debug configuration how to reach your target Raspberry Pi.
+You can also build, deploy, run/debug (as C/C++ Remote %Application) using Eclipse IDE. To do that, execute cmake_eclipse.sh with "-DRASPI=1" build option set. Import the CMake generated Eclipse project in the build tree into Eclipse's workspace. Build the project as usual. Optionally, use the "URHO3D_SCP_TO_TARGET" build option to automatically deploy the ARM executables to target Raspberry Pi device as part of build process; or configure Eclipse to perform a "download to target path" in the Run/Debug configuration for C/C++ Remote %Application. Either way, you have to configure the Run/Debug configuration to let it know how to reach your target Raspberry Pi device.
 
 
 \section Building_MinGW MinGW cross-compile build process
 \section Building_MinGW MinGW cross-compile build process
 
 
-It is possible to cross-compile Urho3D for Windows using a Linux system. The process is largely the same as for the Linux Desktop build process described above.
+It is possible to cross-compile Urho3D for Windows using a Linux host system. The process is largely the same as the \ref Building_Native "Linux native build" process described above.
 
 
-To cross-compile, the MinGW tool-chain (compiler, linker and w32api) needs to be installed on the system. You will also need the DirectX header files, those can be downloaded and installed from the following packet: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz.
+To cross-compile, the MinGW toolchain (compiler, linker and w32api) needs to be installed on the system. You will also need the DirectX header files, those can be downloaded and installed from the following packet: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz.
 
 
-For activating the MinGW tool-chain, and to allow it to find the correct compiler, the MINGW_PREFIX environment variable needs to be set when running cmake_gcc.sh. This variable should be set to the prefix of the compiler name. So, if for example your MinGW compiler is named i686-pc-mingw32-gcc, the MINGW_PREFIX should read i686-pc. Most likely you also need to set MINGW_ROOT environment variable to point to your mingw32 system root.
+For activating the MinGW toolchain, and to allow it to find the correct compiler, the MINGW_PREFIX environment variable needs to be set. This variable should be set to the prefix of the compiler name, e.g. /usr/bin/x86_64-w64-mingw32 where it would be used to find /usr/bin/x86_64-w64-mingw32-gcc and /usr/bin/x86_64-w64-mingw32-g++, etc. Optionally you can also set MINGW_ROOT environment variable to point to your MinGW system root, if it is not installed in a normal expected location.
 
 
-Running cmake_gcc.sh with the MINGW_PREFIX environment variable set, produces an additional mingw-Build directory. Go to this directory and execute make to start the build process. When the build is complete, the Windows executables can be found in the mingw-Bin output directory.
+Execute cmake_mingw.sh then go to the build tree to execute make command. After the build is complete, the Windows executables can be found in the build tree's "Bin" subdirectory.
 
 
-\section Building_64bit Desktop 64bit build
+\section Building_64bit Native 64bit build
 
 
-When using MSVC compiler, the Urho3D CMake build script will configure the Urho3D project to be built in 32-bit by default. When using other non-MSVC compilers (like GCC or clang), the CMake build script will set the default to 32-bit or 64-bit based on the installed toolchain in the host system. You can use the build option "URHO3D_64BIT" to override the default, by setting the option to '0' (for 32-bit) and '1' (for 64-bit) explicitly. For MSVC on Windows platform, setting the option to '1' also instructs the build script to use a 64-bit solution generator.
+When using MSVC compiler, Urho3D common CMake module configures the build tree to target a 32-bit platform by default. When using other non-MSVC compilers (like GCC or Clang), the module sets the default to 32-bit or 64-bit based on the chosen toolchain in the build tree. You can, however, use the "URHO3D_64BIT" build option to override the default, i.e. by setting the option to '0' (for 32-bit) and '1' (for 64-bit) explicitly.
 
 
 \section Building_Library Library build
 \section Building_Library Library build
 
 
 As of V1.31, the build process first builds the Urho3D library target (either static or shared). The library is then linked against by other targets like tools and samples that reference Urho3D as one of the external libraries. The Urho3D library type is defaulted to static, so the build process would generate standalone executables as previous releases. The Urho3D library type can be changed using "URHO3D_LIB_TYPE" build option.
 As of V1.31, the build process first builds the Urho3D library target (either static or shared). The library is then linked against by other targets like tools and samples that reference Urho3D as one of the external libraries. The Urho3D library type is defaulted to static, so the build process would generate standalone executables as previous releases. The Urho3D library type can be changed using "URHO3D_LIB_TYPE" build option.
 
 
-To install the Urho3D library (or should we call it SDK), use the usual 'make install' command when using Makefile. There is an equivalent command in Visual Studio and Xcode IDE to build 'install' target instead of the default 'all' target. This could be useful when you want your application to always link against a 'stable' installed version of the Urho3D library, while keeping your Urho3D project root tree in sync with origin/master. That is, install the newly built library after you have tested the changes do not break your application during development.
+To install the Urho3D library as an SDK, use the usual 'make install' command. There is an equivalent built-in target called "install" in Visual Studio solution and Xcode project to perform the SDK installation. This could be useful when you want your application to always link against a 'stable' installed version of the Urho3D library, while keeping your Urho3D project root tree in sync with origin/master.
 
 
 Refer to \ref UsingLibrary "Using Urho3D as external library" on how to setup your own project to use Urho3D as external library.
 Refer to \ref UsingLibrary "Using Urho3D as external library" on how to setup your own project to use Urho3D as external library.
 
 
@@ -132,22 +128,26 @@ Urho3D should be built as a shared library if your application consists of multi
 
 
 \section Building_Docs Documentation build
 \section Building_Docs Documentation build
 
 
-If URHO3D_DOCS build option is set then a normal (ALL) build would not only build Urho3D software but also Urho3D documentation automatically. If it is not then the documentation can be generated by manually invoking 'make doc' command or its equivalent command in IDE.
+If "URHO3D_DOCS" build option is set then a normal build would not only build Urho3D binaries but also Urho3D documentation automatically. If the option is not set then the documentation can still be built by manually invoking 'make doc' command or using its equivalent built-in target in IDE.
 
 
-The prerequisites are Doxygen and Graphviz. Tools to dump the \ref ScriptAPI "AngelScript API" for the default \ref Script "scripting" subsystem and the \ref LuaScriptAPI "LuaScript API" (when the LuaScript subsystem is also enabled) will be built internally when all the tools are being built.
+The prerequisites are Doxygen and Graphviz. Tools to dump the \ref ScriptAPI "AngelScript API" for the default \ref Script "scripting" subsystem and the \ref LuaScriptAPI "LuaScript API" (when the LuaScript subsystem is also enabled) are being built at the same time when all the native tools are built.
 
 
 \section Building_Shaders Compiling Direct3D shaders
 \section Building_Shaders Compiling Direct3D shaders
 
 
-When building with the Windows 8 SDK, copy d3dcompiler_46.dll from C:/Program Files (x86)/Windows Kits/8.0/bin/x86 to Urho3D Bin directory so that Urho3D executables will run correctly.
+When building with the Windows 8 SDK, copy d3dcompiler_46.dll from "C:\Program Files (x86)\Windows Kits\8.0\bin\x86" to build tree's "Bin" directory so that Urho3D executables will run correctly.
 
 
-Note that you can also force an OpenGL mode build on Windows by using the CMake option in the table below; OpenGL does not depend on a separate shader compiler DLL.
+Note that you can also force an OpenGL mode build on Windows platform by using the "URHO3D_OPENGL" build option in the table below; OpenGL does not depend on a separate shader compiler DLL.
 
 
 \section Build_Options Build options
 \section Build_Options Build options
 
 
-A number of build options can be defined explicitly when invoking the above cmake_xxxx batch files or shell scripts.\n
+A number of build options can be defined explicitly when invoking the above cmake_xxxx batch files or shell scripts or when configurating the project interactively using cmake-gui. To use one of these build options on the command line interface, pass it in this format "-DOPTION=VALUE" without the quotes.\n
 |Build Option         |V|Description          |
 |Build Option         |V|Description          |
 |---------------------|-|---------------------|
 |---------------------|-|---------------------|
-|URHO3D_64BIT         |-|Enable 64bit build, on MSVC default to 0, on other compilers the default is set based on the installed toolchain on host system|
+|ANDROID              |0|Configure project using Android cross-compiler toolchain (cmake_generic.bat and cmake_generic.sh only)|
+|RASPI                |0|Configure project using Raspberry Pi cross-compiler toolchain (cmake_generic.sh only)|
+|WIN32                |0|Configure project using MinGW cross-compiler toolchain (cmake_generic.sh only)|
+|IOS                  |0|Configure project for targeting iOS platform (cmake_generic.sh and cmake-gui only); use cmake_ios.sh as shortcut|
+|URHO3D_64BIT         |*|Enable 64bit build, on MSVC default to 0, on other compilers the default is set based on the installed toolchain on host system|
 |URHO3D_ANGELSCRIPT   |1|Enable AngelScript scripting support|
 |URHO3D_ANGELSCRIPT   |1|Enable AngelScript scripting support|
 |URHO3D_LUA           |0|Enable Lua scripting support|
 |URHO3D_LUA           |0|Enable Lua scripting support|
 |URHO3D_LUAJIT        |0|Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)|
 |URHO3D_LUAJIT        |0|Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)|
@@ -170,7 +170,6 @@ A number of build options can be defined explicitly when invoking the above cmak
 |URHO3D_TESTING       |0|Enable testing support|
 |URHO3D_TESTING       |0|Enable testing support|
 |URHO3D_TEST_TIME_OUT |5|Number of seconds to test run the executables (when testing support is enabled only)|
 |URHO3D_TEST_TIME_OUT |5|Number of seconds to test run the executables (when testing support is enabled only)|
 |URHO3D_OPENGL        |0|Use OpenGL instead of Direct3D (Windows platform only)|
 |URHO3D_OPENGL        |0|Use OpenGL instead of Direct3D (Windows platform only)|
-|URHO3D_MKLINK        |0|Use mklink command to create symbolic links (Windows Vista and above only)|
 |URHO3D_STATIC_RUNTIME|0|Use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)|
 |URHO3D_STATIC_RUNTIME|0|Use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)|
 |URHO3D_LIB_TYPE      |*|Specify Urho3D library type, possible values are STATIC (\*default) and SHARED|
 |URHO3D_LIB_TYPE      |*|Specify Urho3D library type, possible values are STATIC (\*default) and SHARED|
 |URHO3D_SCP_TO_TARGET |-|Use scp to transfer executables to target system (non-Android cross-compiling build only), SSH digital key must be setup first for this to work, typical value has a pattern of usr@tgt:remote-loc|
 |URHO3D_SCP_TO_TARGET |-|Use scp to transfer executables to target system (non-Android cross-compiling build only), SSH digital key must be setup first for this to work, typical value has a pattern of usr@tgt:remote-loc|
@@ -181,29 +180,7 @@ A number of build options can be defined explicitly when invoking the above cmak
 |ANDROID_NATIVE_API_LEVEL|*|Specify target API level (Android build only), possible values depends on installed NDK version, default to API level 12 on 32-bit ABIs, default to API level 21 on 64-bit ABIs|
 |ANDROID_NATIVE_API_LEVEL|*|Specify target API level (Android build only), possible values depends on installed NDK version, default to API level 12 on 32-bit ABIs, default to API level 21 on 64-bit ABIs|
 |ANDROID_NDK_GDB      |0|Enable ndk-gdb support (Android Debug build only)|
 |ANDROID_NDK_GDB      |0|Enable ndk-gdb support (Android Debug build only)|
 
 
-Note that build option values specified via command line are cached by CMake. The cached values will be used by CMake in the subsequent invocation. That is, the same build options are not required to be specified again and again. Once a non-default build option value is being cached, it can only be reverted back to its default value by explicitly setting it via command line. That is, simply by NOT passing the corresponding build option would not work. One way to revert all the build options to their default values is by clearing the CMake cache by calling cmake_clean.bat or cmake_clean.sh.
-
-\section Using_CMake_GUI Using cmake-gui to configure and generate Urho3D project file
-
-Instead of using one of the provided batch files or shell scripts, you can use cmake-gui to configure and generate Urho3D project file. However, you have to adhere to the current limitations:
-- The build directory must be located inside the Urho3D project root directory and sibling of the "Source" directory.\n
-- The build directory must be named accordingly based on the target platform.\n
-    - On desktop/native platform: Build\n
-    - On Windows platform using MinGW: mingw-Build\n
-    - On iOS platform: ios-Build\n
-    - On Android platform: android-Build\n
-    - On Raspberry Pi platform: raspi-Build\n
-- The runtime and archive output directories are automatically set based on the target platform regardless of the build directory name (should you choose not to adhere with the above). For example on Android platform, they will be android-Bin and android-Lib, respectively.\n
-If you choose not to adhere with this build directory naming convention then you will have to install the Urho3D library into your local filesystem in order to use the Urho3D library in your external project. See \ref Building_Library and \ref FromSDK.
-- All the post-CMake workaround and/or bug fixes that are scripted in the batch files or shell scripts are not applied to the generated project file.
-
-Steps to configure:
--# In the Urho3D project root directory, invoke "cmake-gui Source".
--# Set the build directory name.
--# Configure and update the build options as many times as necessary until there are no more new options in red. For the first configuration, choose the generator you like to use. Click the Group check box to group the build options.
-    - In the Ungrouped Entries: check IOS option when targeting it on Xcode.
-    - In the URHO3D group: check any of the options you desire. Some of the options when checked may cause new options to be made available in the subsequent configuration loop.
--# Generate when all the configurations are done.
+Note that the specified build option values are cached by CMake. The cached values will be used by CMake in the subsequent invocation. That is, the same build options are not required to be specified again and again. But once a non-default build option value is being cached, it can only be reverted back to its default value by explicitly resetting it. That is, simply by not passing the corresponding build option would not work. One way to revert all the build options to their default values is by clearing the CMake cache by calling cmake_clean.bat or cmake_clean.sh.
 
 
 \page Running Running Urho3D player application
 \page Running Running Urho3D player application
 
 

+ 8 - 435
Readme.txt

@@ -127,443 +127,16 @@ See section "Documentation build" below on how to automate documentation
 generation as part of the build process.
 generation as part of the build process.
 
 
 The documentation is also available online at
 The documentation is also available online at
-http://urho3d.github.io/documentation/HEAD/index.html
+  http://urho3d.github.io/documentation/HEAD/index.html
 
 
+Documentation on how to build Urho3D:
+  http://urho3d.github.io/documentation/HEAD/_building.html
+Documentation on how to use Urho3D as external library
+  http://urho3d.github.io/documentation/HEAD/_using_library.html
 
 
-Building prerequisites
-----------------------
-
-Although all required third-party libraries are included as source code, there
-are system-level dependencies that must be satisfied before Urho3D can be built
-successfully:
-
-- For Windows, the June 2010 DirectX SDK needs to be installed.
-
-- For Linux, the following development packages need to be installed:
-  libx11-dev, libxrandr-dev, libasound2-dev on Debian-based distros;
-  libX11-devel, libXrandr-devel, alsa-lib-devel on RedHat-based distros.
-  Also install the package libgl1-mesa-dev (Debian) or mesa-libGL-devel (RH)
-  if your GPU driver does not include OpenGL headers & libs. Building as 32-bit 
-  on a 64-bit system requires installing also the 32-bit versions of the 
-  development libraries.
-
-- For Raspberry Pi, the following development packages need to be installed:
-  libraspberrypi0, libraspberrypi-dev, libasound2-dev, libudev-dev on Raspbian;
-  raspberrypi-vc-libs, raspberrypi-vc-libs-devel, alsa-lib-devel, systemd-devel
-  on Pidora. The first two packages which contain the Broadcom VideoCore IV
-  libraries and development headers should normally come preinstalled.
-
-- For Mac OS X, the Xcode developer tools package should include everything
-  necessary.
-
-- For Android, the Android SDK and Android NDK (minimum API level 12) need to be
-  installed. Optionally, also install Eclipse ADT plugin for building and 
-  deployment via Eclipse.
-
-To run Urho3D, the minimum system requirements are:
-
-- Windows: CPU with SSE instructions support, Windows XP or newer, DirectX 9.0c,
-  GPU with Shader Model 2 support (Shader Model 3 recommended.)
-
-- Linux & Mac OS X: CPU with SSE instructions support, GPU with OpenGL 2.0
-  support, EXT_framebuffer_object and EXT_packed_depth_stencil extensions.
-
-- Raspberry Pi: Model B revision 2.0 with at least 128 MB of 512 MB SDRAM
-  allocated for GPU. OpenGL ES 2.0 capable GPU.
-
-- Android: OS version 2.3 or newer, OpenGL ES 2.0 capable GPU.
-
-- iOS: OpenGL ES 2.0 capable GPU.
-
-SSE requirement can be eliminated by disabling the use of SSE instruction set,
-see "Build options" below.
-
-
-Desktop build process
----------------------
-
-On desktop systems 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 provided batch files or shell
-   scripts on the respective platform.
-   
-    Windows: cmake_vs2008.bat, cmake_vs2010.bat, cmake_vs2012.bat, or
-             cmake_mingw.bat,
-    Linux: cmake_gcc.sh, cmake_eclipse.sh, or cmake_codeblocks.sh,
-    Mac OS X: cmake_gcc.sh or cmake_macosx.sh.
-
-2) Open the CMake's generated project file in the IDE of your choice. Change the
-   build configuration (Debug/Release) and then build all the targets.
-
-   Visual Studio: open Urho3D.sln from the Build directory.
-   Xcode: open Urho3D.xcodeproj.
-   CodeBlocks: open Urho3D.cbp.
-   Eclipse: import project using File|Import "Existing Projects into Workspace".
-   GCC: execute make from the Build directory in a terminal/console.
-
-Note that Eclipse requires CDT plugin to build C/C++ project.
-
-If using MinGW to compile, DirectX headers may need to be acquired separately.
-They can be copied to the MinGW installation eg. from the following package:
-http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz. These will
-be missing some of the headers related to shader compilation, so a MinGW build 
-will use OpenGL by default. To build in Direct3D9 mode, the MinGW-w64 port is 
-necessary: http://mingw-w64.sourceforge.net/. Using it, Direct3D9 can be 
-enabled with the CMake option -DURHO3D_OPENGL=0.
-
-After the build is complete, the programs can be run from the Bin directory.
-These include the Urho3D player application, which can run application scripts,
-the tools, and C++ sample applications if they have been enabled.
-
-To run the Urho3D player application from the Visual Studio debugger, set the 
-Urho3DPlayer project as the startup project and enter its relative path and 
-filename into Properties -> Debugging -> Command: ..\..\..\Bin\Urho3DPlayer.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 the Urho3DPlayer application 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/NinjaSnowWar.as -w
-
-To run from Eclipse on Linux, locate and select the Urho3DPlayer executable in
-the Project Explorer. From the menu, choose "Run Configurations" to create a new
-launch configuration for "C/C++ Application". Switch to "Arguments" tab, specify
-the argument required by Urho3DPlayer executable.
-
-To run from Xcode on Mac OS X, edit the Product Scheme to set "Run" setting
-to execute "Urho3DPlayer" in the "Info" tab. In the "Arguments" tab, specify the
-arguments required by Urho3DPlayer executable. Ensure the check boxes are ticked
-on the argument entries that you want to be active.
-
-CMake caches some internal variables to speed up the subsequent invocation of
-the CMake build script. This is normally a good thing. However, there are cases
-when this is not desirable, for instance when switching CMake generators or
-after upgrading development software components. In such cases, it is recomended
-to first clean the CMake cache by invoking cmake_clean.bat or cmake_clean.sh.
-
-
-Android build process
----------------------
-
-First, if you are building under Windows host without MKLINK support then copy
-Bin/Data and Bin/CoreData directories to the Source/Android/assets directory
-(you can use the provided batch file CopyData.bat). This step is not necessary
-for Windows with MKLINK support and non-Windows host because the build script
-uses symbolic links for host development environments that support it.
-
-Set the ANDROID_NDK environment variable to point to your Android NDK. On
-Windows, ensure that make.exe from the Android NDK is included in the path and
-is executable from the command line.
-
-On Windows, execute cmake_android.bat. If your user account has privilege to use
-MKLINK then you have the option to provide the build option "-DURHO3D_MKLINK=1"
-when invoking the cmake_android.bat to generate out-of-source build tree. Then
-go to the build tree directory which could be either 'Source/Android' or
-'android-Build' (when using MKLINK) and execute the below commands to start the
-build.
-
-- android update project -p . -t 1 (replace id to match the desired target API)
-- make -j8 (replace the number to match your host's number of logical CPU cores)
-- ant debug
-
-On OS X or Linux, execute cmake_gcc.sh (the presence of ANDROID_NDK environment
-variable instructs the shell script to also generate project file for Android
-build besides normal desktop build). Then go to the build tree (which is
-currently defaulted to 'android-Build' directory) and execute the same commands
-as above.
-
-After the commands finish successfully, the APK should have been generated in
-the build tree's "bin" subdirectory, from where it can be installed on a device
-or an emulator. The command "ant installd" can be used for this. After the debug
-APK has been installed, you can use "rake android" command to automate the test
-running of the APK on the attached Android device.
-
-For a release build, use the "ant release" command instead of "ant debug" and
-follow the Android SDK instructions on how to sign your APK properly.
-
-By default the Android package for Urho3D is com.googlecode.urho3d. For a real
-application you must replace this with your own package name. The Urho3D
-activity subclasses the SDLActivity from org.libsdl.app package, whose name (or
-the JNI code from SDL library) does not have to be changed.
-
-Note that the native code is built by default for armeabi-v7a ABI. To make your
-program compatible also with old Android devices, build also an armeabi version
-by executing the CMake batch file or shell script again with the build option
-"-DANDROID_ABI=armeabi" added, then execute make again in the build directory.
-Similarly, the native code can be built using 64-bit ABI by changing the value
-of this build option. See \ref Build_Options "Build options" for all the
-possible values.
-
-You can also build and deploy using Eclipse IDE with ADT plugin. To do that,
-after setting the ANDROID_NDK environment variable then run cmake_eclipse.sh
-instead of cmake_gcc.sh. Import "Existing Android Code into Workspace" from the
-CMake generated Eclipse project file in the build tree. Switch Eclipse IDE to
-use Java Perspective. Update project properties to choose the desired Android
-API target. Choose "Run" to let ADT automatically build and deploy the
-application to Android (virtual) device.
-
-
-iOS build process
------------------
-
-Run cmake_ios.sh. This generates an Xcode project named Urho3D.xcodeproj.
-
-Open the Xcode project and check the properties for the Urho3D project (topmost
-in the Project Navigator.) In Architectures -> Base SDK, choose your iOS SDK
-(CMake would automatically select latest iOS when generating the Xcode project).
-In Code Signing, enter your developer identity as necessary.
-
-The Urho3DPlayer target will actually build the application bundle and copy
-resources from Bin/Data and Bin/CoreData directories. Edit its build scheme to
-choose debug or release mode.
-
-To run from Xcode on iPhone/iPad Simulator, edit the Product Scheme to set "Run"
-destination setting to "iPhone Simulator" or "iPad Simulator", and executable
-to "Urho3DPlayer.app".
-
-
-Raspberry Pi build process
---------------------------
-
-For native build on Raspberry Pi itself, use the similar process for Linux
-Desktop build described above.
-
-For cross-compiling build on another build/host machine, firstly set the
-RASPI_TOOL environment variable to point to your Raspberry Pi Cross-Compiling
-tool where all the arm-linux-gnueabihf-* executables are located. You can setup
-the tool using crosstool-NG (http://crosstool-ng.org/) or just download one
-from https://github.com/raspberrypi/tools. Secondly, set the RASPI_ROOT
-environment variable to point to your Raspbian or Pidora system root. You must
-install the Urho3D prerequisites software development packages for Raspberry Pi
-(see "Building_Prerequisites") in the system root before attempting to do the
-Urho3D cross-compiling build. You can download a Raspbian system root from
-https://github.com/urho3d/rpi-sysroot.
-
-When running cmake_gcc.sh with RASPI_TOOL environment variable set, it tells
-build script to generate additional raspi-Build directory for cross-compiling.
-Go to this raspi-Build directory and proceed to execute make. After the build
-is complete, the ARM executables can be found in Bin-CC output directory.
-
-You can also build, deploy, run/debug (as C/C++ Remote Application) using
-Eclipse IDE, if you run cmake_eclipse.sh to generate the project file. Import
-the CMake generated Eclipse project in the raspi-Build directory into Eclipse's
-workspace. Build the project as usual. Use the URHO3D_SCP_TO_TARGET build option
-to automatically deploy the ARM executables to target Raspberry Pi as part of
-every project build or configure Eclipse to perform a "download to target path"
-in the Run/Debug configuration for C/C++ Remote Application. Either way, you
-have to configure the Run/Debug configuration how to reach your target Raspberry
-Pi.
-
-
-MinGW cross-compile build process
----------------------------------
-
-It is possible to cross-compile Urho3D for Windows using a Linux system. The
-process is largely the same as for the Linux Desktop build process described
-above.
-
-To cross-compile, the MinGW tool-chain (compiler, linker and w32api) needs to be
-installed on the system. You will also need the DirectX header files, those can
-be downloaded and installed from the following packet:
-http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz.
-
-For activating the MinGW tool-chain, and to allow it to find the correct
-compiler, the MINGW_PREFIX environment variable needs to be set when running
-cmake_gcc.sh. This variable should be set to the prefix of the compiler name.
-So, if for example your MinGW compiler is named i686-pc-mingw32-gcc, the
-MINGW_PREFIX should read i686-pc. Most likely you also need to set MINGW_ROOT
-environment variable to point to your mingw32 system root.
-
-Running cmake_gcc.sh with the MINGW_PREFIX environment variable set, produces
-an additional mingw-Build directory. Go to this directory and execute make to
-start the build process. When the build is complete, the Windows executables can
-be found in the mingw-Bin output directory.
-
-
-Desktop 64bit build
--------------------
-
-When using MSVC compiler, the Urho3D CMake build script will configure the
-Urho3D project to be built in 32-bit by default. When using other non-MSVC
-compilers (like GCC or clang), the CMake build script will set the default to
-32-bit or 64-bit based on the installed toolchain in the host system. You can
-use the build option "URHO3D_64BIT" to override the default, by setting the
-option to '0' (for 32-bit) and '1' (for 64-bit) explicitly. For MSVC on Windows
-platform, setting the option to '1' also instructs the build script to use a
-64-bit solution generator.
-
-
-Library build
--------------
-
-As of v1.31, the build process first builds the Urho3D library target (either
-static or shared). The library is then linked against by other targets like
-tools and samples that reference Urho3D as one of the external libraries. The
-Urho3D library type is defaulted to static, so the build process would generate
-standalone executables as previous releases. The Urho3D library type can be
-changed using "URHO3D_LIB_TYPE" build option.
-
-To install the Urho3D library (or should we call it SDK), use the usual
-'make install' command when using Makefile. There is an equivalent command in
-Visual Studio and Xcode IDE to build 'install' target instead of the default
-'all' target. This could be useful when you want your application to always link
-against a 'stable' installed version of the Urho3D library, while keeping your
-Urho3D project root tree in sync with origin/master. That is, install the newly
-built library after you have tested the changes do not break your application
-during development.
-
-Refer to "Using Urho3D as external library" on how to setup your own project to
-use Urho3D as external library.
-
-
-Documentation build
--------------------
-
-If URHO3D_DOCS build option is set then a normal (ALL) build would not only
-build Urho3D software but also Urho3D documentation automatically. If it is not
-then the documentation can be generated by manually invoking 'make doc' command
-or its equivalent command in IDE.
-
-The prerequisites are Doxygen and Graphviz. Tools to dump the AngelScript API
-for the default scripting subsystem and the LuaScript API (when the LuaScript
-subsystem is also enabled) will be built internally when all the tools are being
-built.
-
-
-Compiling Direct3D shaders
---------------------------
-
-When building with the Windows 8 SDK, copy d3dcompiler_46.dll from
-C:/Program Files (x86)/Windows Kits/8.0/bin/x86 to Urho3D Bin directory so that
-Urho3D executables will run correctly.
-
-Note that you can also force an OpenGL mode build on Windows by using the CMake
-option in the table below; OpenGL does not depend on a separate shader compiler
-DLL.
-
-
-Build options
--------------
-
-A number of build options can be defined explicitly when invoking the above
-cmake_xxxx batch files or shell scripts.
-
-|---------------------|-|------------------------------------------------------|
-|Build Option         |V|Description                                           |
-|---------------------|-|------------------------------------------------------|
-|URHO3D_64BIT         |-|Enable 64bit build, on MSVC default to 0, on other    |
-|                     | | compilers the default is set based on the installed  |
-|                     | | toolchain on host system                             |
-|URHO3D_ANGELSCRIPT   |1|Enable AngelScript scripting support                  |
-|URHO3D_LUA           |0|Enable Lua scripting support                          |
-|URHO3D_LUAJIT        |0|Enable Lua scripting support using LuaJIT (check      |
-|                     | | LuaJIT's CMakeLists.txt for more options)            |
-|URHO3D_LUAJIT_AMALG  |0|Enable LuaJIT amalgamated build (LuaJIT only)         |
-|URHO3D_SAFE_LUA      |0|Enable Lua C++ wrapper safety checks (when Lua        |
-|                     | | scripting support is enabled only)                   |
-|URHO3D_NETWORK       |1|Enable Networking support                             |
-|URHO3D_PHYSICS       |1|Enable Physics support                                |
-|URHO3D_NAVIGATION    |1|Enable Navigation support                             |
-|URHO3D_URHO2D        |1|Enable 2D rendering & physics support                 |
-|URHO3D_SAMPLES       |0|Build sample applications                             |
-|URHO3D_TOOLS         |1|Build standalone tools (Desktop and RPI only;         |
-|                     | | on Android only build Lua standalone tools)          |
-|URHO3D_EXTRAS        |0|Build extras (Desktop and RPI only)                   |
-|URHO3D_DOCS          |0|Generate documentation as part of normal build (the   |
-|                     | | 'doc' builtin target can be used to generate         |
-|                     | | documentation regardless of this option's value)     |
-|URHO3D_DOCS_QUIET    |0|Generate documentation as part of normal build,       |
-|                     | | suppress generation process from sending anything to |
-|                     | | stdout                                               |
-|URHO3D_SSE           |1|Enable SSE instruction set                            |
-|URHO3D_MINIDUMPS     |1|Enable minidumps on crash (VS only)                   |
-|URHO3D_FILEWATCHER   |1|Enable filewatcher support                            |
-|URHO3D_PROFILING     |1|Enable profiling support                              |
-|URHO3D_LOGGING       |1|Enable logging support                                |
-|URHO3D_TESTING       |0|Enable testing support                                |
-|URHO3D_TEST_TIME_OUT |5|Number of seconds to test run the executables (when   |
-|                     | | testing support is enabled only)                     |
-|URHO3D_OPENGL        |0|Use OpenGL instead of Direct3D (Windows platform only)|
-|URHO3D_MKLINK        |0|Use mklink command to create symbolic links (Windows  |
-|                     | | Vista and above only)                                |
-|URHO3D_STATIC_RUNTIME|0|Use static C/C++ runtime libraries and eliminate the  |
-|                     | | need for runtime DLLs installation (VS only)         |
-|URHO3D_LIB_TYPE      |*|Specify Urho3D library type, possible values are      |
-|                     | | STATIC (*default) and SHARED                         |
-|URHO3D_SCP_TO_TARGET |-|Use scp to transfer executables to target system (non-|
-|                     | | Android cross-compiling build only), SSH digital key |
-|                     | | must be setup first for this to work, typical value  |
-|                     | | has a pattern of usr@tgt:remote-loc                  |
-|CMAKE_BUILD_TYPE     |*|Specify CMake build configuration (single-            |
-|                     | | configuration generator only), possible values are   |
-|                     | | Release (*default), RelWithDebInfo, and Debug        |
-|CMAKE_OSX_           |-|Specify Mac OS X deployment target (OSX build only);  |
-| DEPLOYMENT_TARGET   | | default to current running OS X if not specified     |
-|IPHONEOS_            |-|Specify iPhone OS deployment target (iOS build only); |
-| DEPLOYMENT_TARGET   | | default to latest installed iOS SDK if not specified |
-|ANDROID_ABI          |*|Specify target ABI (Android build only), possible     |
-|                     | | values are arm64-v8a, armeabi, armeabi-v6 with VFP,  |
-|                     | | armeabi-v7a (*default), armeabi-v7a with NEON,       |
-|                     | | armeabi-v7a with VFPV3, mips, mips64, x86, and x86_64|
-|ANDROID_NATIVE_API   |*|Specify target API level (Android build only),        |
-| _LEVEL              | | possible values depends on installed NDK version,    |
-|                     | | default to API level 12 on 32-bit ABIs,              |
-|                     | | default to API level 21 on 64-bit ABIs               |
-|ANDROID_NDK_GDB      |0|Enable ndk-gdb support (Android Debug build only)     |
-|---------------------|-|------------------------------------------------------|
-
-Note that build option values specified via command line are cached by CMake.
-The cached values will be used by CMake in the subsequent invocation. That is,
-the same build options are not required to be specified again and again. Once a
-non-default build option value is being cached, it can only be reverted back to
-its default value by explicitly setting it via command line. That is, simply by
-NOT passing the corresponding build option would not work. One way to revert all
-the build options to their default values is by clearing the CMake cache by
-calling cmake_clean.bat or cmake_clean.sh.
-
-
-Using cmake-gui to configure and generate Urho3D project file
--------------------------------------------------------------
-
-Instead of using one of the provided batch files or shell scripts, you can use
-cmake-gui to configure and generate Urho3D project file. However, you have to
-adhere to the current limitations:
-
-- The build directory must be located inside the Urho3D project root directory
-  and sibling of the "Source" directory.
-- The build directory must be named accordingly based on the target platform.
-    - On desktop/native platform: Build
-    - On Windows platform using MinGW: mingw-Build
-    - On iOS platform: ios-Build
-    - On Android platform: android-Build
-    - On Raspberry Pi platform: raspi-Build
-- The runtime and archive output directories are automatically set based on the
-  target platform regardless of the build directory name (should you choose not
-  to adhere with the above). For example on Android platform, they will be
-  android-Bin and android-Lib, respectively.
-  If you choose not to adhere with this build directory naming convention then
-  you will have to install the Urho3D library into your local filesystem in
-  order to use the Urho3D library in your external project.
-  See http://urho3d.github.io/documentation/HEAD/_building.html#Building_Library
-  and http://urho3d.github.io/documentation/HEAD/_using_library.html#FromSDK.
-- All the post-CMake workaround and/or bug fixes that are scripted in the batch
-  files or shell scripts are not applied to the generated project file.
-
-Steps to configure:
-
-1. In the Urho3D project root directory, invoke "cmake-gui Source".
-2. Set the build directory name.
-3. Configure and update the build options as many times as necessary until there
-   are no more new options in red. For the first configuration, choose the
-   generator you like to use. Click the Group check box to group the build
-   options.
-    - In the Ungrouped Entries: check IOS option when targeting it on Xcode.
-    - In the URHO3D group: check any of the options you desire. Some of the
-      options when checked may cause new options to be made available in the
-      subsequent configuration loop.
-4. Generate when all the configurations are done.
+Replace HEAD with a specific release version in the above links to obtain the
+documentation pertinent to the specified release. Alternatively, use the
+document-switcher in the documentation website to do so.
 
 
 
 
 History
 History

+ 1 - 32
cmake_android.bat

@@ -20,35 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@echo off
-pushd %~dp0
-:: Define URHO3D_MKLINK to 1 to enable out-of-source build and symbolic linking of resources from Bin directory
-set "build=Source\Android"
-set "source=.."
-set "use_mklink="
-if exist android-Build\CMakeCache.txt. for /F "eol=/ delims=:= tokens=1-3" %%i in (android-Build\CMakeCache.txt) do if "%%i" == "URHO3D_MKLINK" set "use_mklink=%%k"
-:loop
-if not "%1" == "" (
-    if "%1" == "-DURHO3D_MKLINK" set "use_mklink=%~2"
-    shift
-    shift
-    goto loop
-)
-if "%use_mklink%" == "1" (
-    :: Remove cache file from opposite build directory
-    if exist Source\Android\CMakeCache.txt. del /F Source\Android\CMakeCache.txt
-    if exist Source\Android\CMakeFiles. rd /S /Q Source\Android\CMakeFiles
-    cmake -E make_directory android-Build
-    set "build=android-Build"
-    set "source=..\Source"
-    for %%d in (CoreData Data) do if not exist "Source\Android\assets\%%d". mklink /D "Source\Android\assets\%%d" "..\..\..\Bin\%%d"
-    for %%d in (src res assets jni) do if exist "Source\Android\%%d" if not exist "android-Build\%%d". mklink /D "android-Build\%%d" "..\Source\Android\%%d"
-    for %%f in (AndroidManifest.xml build.xml) do if not exist "android-Build\%%f". mklink "android-Build\%%f" "..\Source\Android\%%f"
-) else (
-    if exist android-Build\CMakeCache.txt. del /F android-Build\CMakeCache.txt
-    if exist android-Build\CMakeFiles. rd /S /Q android-Build\CMakeFiles
-) 
-echo on
-@set "OPT="
-cmake -E chdir %build% cmake %OPT% -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=%source%\CMake\Toolchains\android.toolchain.cmake %* %source%
-@popd
+@%~dp0\cmake_generic.bat %* -DANDROID=1

+ 26 - 0
cmake_android.sh

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2008-2014 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+$(dirname $0)/cmake_generic.sh $@ -DANDROID=1
+
+# vi: set ts=4 sw=4 expandtab:

+ 12 - 11
cmake_clean.bat

@@ -21,16 +21,17 @@
 ::
 ::
 
 
 @echo off
 @echo off
-pushd %~dp0
 
 
-:: Clean all the CMake cache
-if exist Build\CMakeCache.txt. del /F Build\CMakeCache.txt
-if exist android-Build\CMakeCache.txt. del /F android-Build\CMakeCache.txt
-if exist Source\Android\CMakeCache.txt. del /F Source\Android\CMakeCache.txt
+:: Clean the CMake cache and CMake generated files
+set "BUILD="
+if not "%~1" == "" if exist "%~1\CMakeCache.txt" set "BUILD=%~1"
+if "%BUILD%" == "" if exist "%cd%\CMakeCache.txt" (set "BUILD=%cd%") else (goto :error)
+del /F "%BUILD%\CMakeCache.txt"
+if exist "%BUILD%\CMakeFiles" rd /S /Q "%BUILD%\CMakeFiles"
+cmake -E touch "%BUILD%\CMakeCache.txt"
 
 
-:: Clean CMakeFiles directories
-if exist Build\CMakeFiles. rd /S /Q Build\CMakeFiles
-if exist android-Build\CMakeFiles. rd /S /Q android-Build\CMakeFiles
-if exist Source\Android\CMakeFiles. rd /S /Q Source\Android\CMakeFiles
-
-popd
+goto :eof
+:error
+echo An error has occured, build tree has to be provided as the first argument OR call this script in a build tree itself
+exit /B 1
+:eof

+ 4 - 8
cmake_clean.sh

@@ -21,13 +21,9 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-# Ensure we are in project root directory
-cd $( dirname $0 )
-
-# Clean all the CMake cache
-find . -name CMakeCache.txt -exec rm {} \;
-
-# For Android build, need to clean the CMakeFiles as well
-rm -rf android-Build/CMakeFiles
+# Clean the CMake cache and CMake generated files in the build tree
+if [ $1 ] && [ -f $1/CMakeCache.txt ]; then BUILD=$1; elif [ -f $(pwd)/CMakeCache.txt ]; then BUILD=$(pwd); else echo An error has occured, build tree has to be provided as the first argument OR call this script in a build tree itself; exit 1; fi
+rm -rf $BUILD/{CMakeCache.txt,CMakeFiles}
+touch $BUILD/CMakeCache.txt
 
 
 # vi: set ts=4 sw=4 expandtab:
 # vi: set ts=4 sw=4 expandtab:

+ 1 - 1
cmake_codeblocks.sh

@@ -21,6 +21,6 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-$( dirname $0 )/cmake_gcc.sh codeblocks $@
+$(dirname $0)/cmake_generic.sh $@ -G "CodeBlocks - Unix Makefiles"
 
 
 # vi: set ts=4 sw=4 expandtab:
 # vi: set ts=4 sw=4 expandtab:

+ 1 - 1
cmake_eclipse.sh

@@ -21,7 +21,7 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-$( dirname $0 )/cmake_gcc.sh eclipse $@
+$(dirname $0)/cmake_generic.sh $@ -G "Eclipse CDT4 - Unix Makefiles"
 
 
 # After importing the generated project into Eclipse workspace, set the [Build], [Subprojects], and [Targets] linked resources property as 'Derived'
 # After importing the generated project into Eclipse workspace, set the [Build], [Subprojects], and [Targets] linked resources property as 'Derived'
 # to exclude the derived resources in those folders from being listed in the Open Resource and Search Result list
 # to exclude the derived resources in those folders from being listed in the Open Resource and Search Result list

+ 0 - 67
cmake_gcc.sh

@@ -1,67 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2008-2014 the Urho3D project.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-
-# Ensure we are in project root directory
-cd $( dirname $0 )
-SOURCE=`pwd`/Source
-
-# Define helpers
-. ./.bash_helpers.sh
-
-# Detect CMake toolchains directory if it is not provided explicitly
-[ "$TOOLCHAINS" == "" ] && TOOLCHAINS=$SOURCE/CMake/Toolchains
-[ ! -d $TOOLCHAINS -a -d $URHO3D_HOME/CMake/Toolchains ] && TOOLCHAINS=$URHO3D_HOME/CMake/Toolchains
-[ ! -d $TOOLCHAINS -a -d $CMAKE_PREFIX_PATH/share/Urho3D/CMake/Toolchains ] && TOOLCHAINS=$CMAKE_PREFIX_PATH/share/Urho3D/CMake/Toolchains
-
-# Add support for Eclipse IDE
-IFS=#
-GENERATOR="Unix Makefiles"
-[[ $1 =~ ^eclipse$ ]] && GENERATOR="Eclipse CDT4 - Unix Makefiles" && shift && xmlstarlet --version >/dev/null 2>&1 && HAS_XMLSTARLET=1
-
-# Add support for CodeBlocks IDE
-[[ $1 =~ ^codeblocks$ ]] && GENERATOR="CodeBlocks - Unix Makefiles"
-
-# Add support for both native and cross-compiling build for Raspberry Pi
-[[ $( uname -m ) =~ ^armv6 ]] && PLATFORM="-DRASPI=1"
-
-# Create project with the respective CMake generators
-OPT=
-[ $ANDROID_NDK ] && msg "Android build" && cmake -E make_directory android-Build && cmake -E chdir android-Build cmake $OPT -G $GENERATOR -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/android.toolchain.cmake $@ $SOURCE && post_cmake android-Build
-[ $RASPI_TOOL ] && msg "Raspberry Pi build" && cmake -E make_directory raspi-Build && cmake -E chdir raspi-Build cmake $OPT -G $GENERATOR -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/raspberrypi.toolchain.cmake $@ $SOURCE && post_cmake raspi-Build
-[ $MINGW_PREFIX ] && msg "MinGW build" && cmake -E make_directory mingw-Build && cmake -E chdir mingw-Build cmake $OPT -G $GENERATOR -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/mingw.toolchain.cmake $@ $SOURCE && post_cmake mingw-Build
-[ ! $SKIP_NATIVE ] && msg "Native build" && cmake -E make_directory Build && cmake -E chdir Build cmake $OPT -G $GENERATOR $PLATFORM $@ $SOURCE && post_cmake Build
-unset IFS
-
-# Create symbolic links in the build directories
-if [ $ANDROID_NDK ]; then
-    for dir in CoreData Data; do
-        cmake -E create_symlink ../../../Bin/$dir Source/Android/assets/$dir
-    done
-    for f in AndroidManifest.xml build.xml src res assets jni; do
-        if [ -e Source/Android/$f ]; then cmake -E create_symlink ../Source/Android/$f android-Build/$f; fi
-    done
-fi
-
-exit 0
-
-# vi: set ts=4 sw=4 expandtab:

+ 66 - 0
cmake_generic.bat

@@ -0,0 +1,66 @@
+::
+:: Copyright (c) 2008-2014 the Urho3D project.
+::
+:: Permission is hereby granted, free of charge, to any person obtaining a copy
+:: of this software and associated documentation files (the "Software"), to deal
+:: in the Software without restriction, including without limitation the rights
+:: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+:: copies of the Software, and to permit persons to whom the Software is
+:: furnished to do so, subject to the following conditions:
+::
+:: The above copyright notice and this permission notice shall be included in
+:: all copies or substantial portions of the Software.
+::
+:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+:: THE SOFTWARE.
+::
+
+@echo off
+
+:: Determine source tree and build tree
+set "BUILD="
+if "%~1" == "" goto :continue
+set "ARG1=%~1"
+if "%ARG1:~0,1%" equ "-" goto :continue
+set "BUILD=%~1"
+shift
+:continue
+if "%BUILD%" == "" if exist "%cd%\CMakeCache.txt" (set "BUILD=%cd%") else (goto :error)
+set "SOURCE=%~dp0"
+
+:: Detect CMake toolchains directory if it is not provided explicitly
+if "%TOOLCHAINS%" == "" set "TOOLCHAINS=%SOURCE%/CMake/Toolchains"
+if not exist "%TOOLCHAINS%" if exist "%URHO3D_HOME%/CMake/Toolchains" set "TOOLCHAINS=%URHO3D_HOME%/CMake/Toolchains"
+if not exist "%TOOLCHAINS%" if exist "%CMAKE_PREFIX_PATH%/share/Urho3D/CMake/Toolchains" set "TOOLCHAINS=%CMAKE_PREFIX_PATH%/share/Urho3D/CMake/Toolchains"
+:: BEWARE that the TOOLCHAINS variable leaks to caller's environment!
+
+:: Default to native generator and toolchain if none is specified explicitly
+set "OPTS="
+set "arch="
+if exist "%BUILD%\CMakeCache.txt" for /F "eol=/ delims=:= tokens=1-3" %%i in ("%BUILD%\CMakeCache.txt") do if "%%i" == "URHO3D_64BIT" if "%%k" == "1" set "arch= Win64"
+:loop
+if not "%~1" == "" (
+    if "%~1" == "-DANDROID" if "%~2" == "1" set "OPTS=-G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=%TOOLCHAINS%\android.toolchain.cmake"
+    if "%~1" == "-DURHO3D_64BIT" if "%~2" == "1" set "arch= Win64"
+    if "%~1" == "-DURHO3D_64BIT" if "%~2" == "0" set "arch="
+    if "%~1" == "-VS" set "OPTS=-G "Visual Studio %~2%arch%""
+    shift
+    shift
+    goto loop
+)
+
+:: Create project with the chosen CMake generator and toolchain
+echo on
+cmake -E make_directory %BUILD% && cmake -E chdir %BUILD% cmake %OPTS% %* %SOURCE%
+@echo off
+
+goto :eof
+:error
+echo An error has occured, build tree has to be provided as the first argument OR call this script in a build tree itself
+exit /B 1
+:eof

+ 64 - 0
cmake_generic.sh

@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2008-2014 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+# Determine source tree and build tree
+if [ $1 ] && [[ ! $1 =~ ^- ]]; then BUILD=$1; shift; elif [ -f $(pwd)/CMakeCache.txt ]; then BUILD=$(pwd); else echo An error has occured, build tree has to be provided as the first argument OR call this script in a build tree itself; exit 1; fi
+SOURCE=$(dirname $0)
+
+# Define helpers
+. $SOURCE/.bash_helpers.sh
+
+# Detect CMake toolchains directory if it is not provided explicitly
+[ "$TOOLCHAINS" == "" ] && TOOLCHAINS=$SOURCE/CMake/Toolchains
+[ ! -d $TOOLCHAINS -a -d $URHO3D_HOME/CMake/Toolchains ] && TOOLCHAINS=$URHO3D_HOME/CMake/Toolchains
+[ ! -d $TOOLCHAINS -a -d $CMAKE_PREFIX_PATH/share/Urho3D/CMake/Toolchains ] && TOOLCHAINS=$CMAKE_PREFIX_PATH/share/Urho3D/CMake/Toolchains
+
+# Default to native generator and toolchain if none is specified explicitly
+OPTS=
+for a in $@; do
+    case $a in
+        --fix-scm)
+            FIX_SCM=1
+            ;;
+        Eclipse CDT4 - Unix Makefiles)
+            ECLIPSE=1 && if xmlstarlet --version >/dev/null 2>&1; then HAS_XMLSTARLET=1; fi
+            ;;
+        -DIOS=1)
+            IOS=1 && OPTS="-G Xcode"
+            ;;
+        -DANDROID=1)
+            ANDROID=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/android.toolchain.cmake"
+            ;;
+        -DRASPI=1)
+            RASPI=1 && if [[ ! $(uname -m) =~ ^armv6 ]]; then OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/raspberrypi.toolchain.cmake"; fi
+            ;;
+        -DWIN32=1)
+            WINDOWS=1 && OPTS="-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAINS/mingw.toolchain.cmake"
+            ;;
+    esac
+done
+
+# Create project with the chosen CMake generator and toolchain
+cmake -E make_directory $BUILD && cmake -E chdir $BUILD cmake $OPTS $@ $SOURCE && post_cmake
+
+# vi: set ts=4 sw=4 expandtab:

+ 1 - 1
cmake_ios.sh

@@ -21,6 +21,6 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-$( dirname $0 )/cmake_macosx.sh -DIOS=1 $@
+$(dirname $0)/cmake_generic.sh $@ -DIOS=1
 
 
 # vi: set ts=4 sw=4 expandtab:
 # vi: set ts=4 sw=4 expandtab:

+ 1 - 35
cmake_macosx.sh

@@ -21,40 +21,6 @@
 # THE SOFTWARE.
 # THE SOFTWARE.
 #
 #
 
 
-# Ensure we are in project root directory
-cd $( dirname $0 )
-
-# Create out-of-source build directory
-SOURCE=`pwd`/Source
-BUILD=Build
-if [ "$1" == "-DIOS=1" ]; then
-    BUILD=ios-Build
-fi
-cmake -E make_directory $BUILD
-
-# Create project with the Xcode generator
-OPT=
-cmake -E chdir $BUILD cmake $OPT -G "Xcode" $@ $SOURCE
-
-# Temporary fix: can be removed when CMake minimum required has reached 2.8.12
-if [ "$1" == "-DIOS=1" -a -e $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make ]; then
-    # Due to a bug in the CMake/Xcode generator (prior to version 2.8.12) where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
-    # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
-    # Since version 2.8.12 CMake does not generate XCODE_DEPEND_HELPER.make script anymore, so we skip this fix when the script does not exist
-    sed -i '' 's/\/Contents\/MacOS//g' $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make
-fi
-
-# Temporary fix: known CMake bug (still exists in 2.8.12)
-if [ "$1" == "-DIOS=1" -a -e $BUILD/CMakeScripts/install_postBuildPhase.makeDebug ]; then
-    # Due to a bug in the CMake/Xcode generator that prevents iOS targets (library and bundle) to be installed correctly
-    # (see http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency),
-    # below temporary fix is required to work around the bug
-    sed -i '' 's/$(EFFECTIVE_PLATFORM_NAME)//g' $BUILD/CMakeScripts/install_postBuildPhase.make*
-fi
-
-# Set Xcode build settings to skip dSYM file generation for Debug configuration (other configurations still use the default dwarf-with-dsym)
-if [ "$1" == "-DIOS=1" -a -e $BUILD/*.xcodeproj/project.pbxproj ] && perl -v >/dev/null 2>&1; then
-    perl -i -pe 'BEGIN {$/=undef} s/(Begin XCBuildConfiguration.*?Debug.*?Settings = {\n)/\1DEBUG_INFORMATION_FORMAT = dwarf;\n/s' $BUILD/*.xcodeproj/project.pbxproj
-fi
+$(dirname $0)/cmake_generic.sh $@ -G Xcode
 
 
 # vi: set ts=4 sw=4 expandtab:
 # vi: set ts=4 sw=4 expandtab:

+ 1 - 7
cmake_mingw.bat

@@ -20,10 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@echo off
-pushd %~dp0
-cmake -E make_directory Build
-echo on
-@set "OPT="
-cmake -E chdir Build cmake %OPT% -G "MinGW Makefiles" %* ..\Source
-@popd
+@%~dp0\cmake_generic.bat %* -G "MinGW Makefiles"

+ 26 - 0
cmake_mingw.sh

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2008-2014 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+$(dirname $0)/cmake_generic.sh $@ -DWIN32=1
+
+# vi: set ts=4 sw=4 expandtab:

+ 26 - 0
cmake_raspi.sh

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2008-2014 the Urho3D project.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+$(dirname $0)/cmake_generic.sh $@ -DRASPI=1
+
+# vi: set ts=4 sw=4 expandtab:

+ 1 - 19
cmake_vs2008.bat

@@ -20,22 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@echo off
-pushd %~dp0
-cmake -E make_directory Build
-set "arch="
-set "version=9 2008"
-if exist Build\CMakeCache.txt. for /F "eol=/ delims=:= tokens=1-3" %%i in (Build\CMakeCache.txt) do if "%%i" == "URHO3D_64BIT" if "%%k" == "1" set "arch= Win64"
-:loop
-if not "%1" == "" (
-    if "%1" == "-DURHO3D_64BIT" if "%~2" == "1" set "arch= Win64"
-    if "%1" == "-DURHO3D_64BIT" if "%~2" == "0" set "arch="
-    if "%1" == "VERSION" set "version=%~2"
-    shift
-    shift
-    goto loop
-)
-echo on
-@set "OPT="
-cmake -E chdir Build cmake %OPT% -G "Visual Studio %version%%arch%" %* ..\Source
-@popd
+@%~dp0\cmake_generic.bat %* -VS="9 2008"

+ 1 - 1
cmake_vs2010.bat

@@ -20,4 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@%~dp0\cmake_vs2008.bat VERSION=10 %*
+@%~dp0\cmake_generic.bat %* -VS=10

+ 1 - 1
cmake_vs2012.bat

@@ -20,4 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@%~dp0\cmake_vs2008.bat VERSION=11 %*
+@%~dp0\cmake_generic.bat %* -VS=11

+ 1 - 1
cmake_vs2013.bat

@@ -20,4 +20,4 @@
 :: THE SOFTWARE.
 :: THE SOFTWARE.
 ::
 ::
 
 
-@%~dp0\cmake_vs2008.bat VERSION=12 %*
+@%~dp0\cmake_generic.bat %* -VS=12