Browse Source

Move all the shell scripts and batch files into 'script' directory.

Yao Wei Tjong 姚伟忠 7 years ago
parent
commit
384ed3224f

+ 1 - 0
.gitignore

@@ -90,6 +90,7 @@ CTestTestfile.cmake
 !/Source/ThirdParty/SDL/include/*cmake
 !/Source/ThirdParty/Assimp/cmake-modules/*cmake
 /Docs/**/*.cmake
+/build
 
 # Precompiled header files
 *.gch/

+ 1 - 1
CMakeLists.txt

@@ -75,7 +75,7 @@ install (PROGRAMS ${APP_SCRIPTS} DESTINATION ${DEST_RUNTIME_DIR})   # DEST_RUNTI
 # Install CMake modules and toolchains provided by and for Urho3D
 install (DIRECTORY ${CMAKE_SOURCE_DIR}/CMake/ DESTINATION ${DEST_SHARE_DIR}/CMake)    # Note: the trailing slash is significant
 # Install CMake build scripts
-file (GLOB CMAKE_SCRIPTS ${CMAKE_SOURCE_DIR}/*${SCRIPT_EXT})
+file (GLOB CMAKE_SCRIPTS ${CMAKE_SOURCE_DIR}/script/*${SCRIPT_EXT})
 install (PROGRAMS ${CMAKE_SCRIPTS} DESTINATION ${DEST_SHARE_DIR}/Scripts)
 
 # Setup package variables

+ 6 - 6
Rakefile

@@ -75,7 +75,7 @@ task :cmake do
       build_options = "#{build_options} -D#{option}" unless /build_tree=.*/ =~ option || script == 'cmake_clean'
     end
   }
-  build_tree = ENV["#{platform}_build_tree"] || ENV['build_tree'] || "../#{platform}-Build"
+  build_tree = ENV["#{platform}_build_tree"] || ENV['build_tree'] || "build/#{platform}"
   if ENV['OS']
     # CMake claims mingw32-make does not build correctly with MSYS shell in the PATH env-var and prevents build tree generation if so
     # Our CI on Windows host requires MSYS shell, so we cannot just simply remove it from the PATH globally
@@ -85,7 +85,7 @@ task :cmake do
     ccache_envvar = ENV['CCACHE_SLOPPINESS'] ? '' : 'CCACHE_SLOPPINESS=pch_defines,time_macros'   # Only attempt to do the right thing when user hasn't done it
     ccache_envvar = "#{ccache_envvar} CCACHE_COMPRESS=1" unless ENV['CCACHE_COMPRESS']
   end
-  system "#{ccache_envvar} ./#{script}#{ENV['OS'] ? '.bat' : '.sh'} \"#{build_tree}\" #{build_options}" or abort
+  system "#{ccache_envvar} script/#{script}#{ENV['OS'] ? '.bat' : '.sh'} \"#{build_tree}\" #{build_options}" or abort
 end
 
 # Usage: rake make [<platform>] [<option>=<value> [<option>=<value>]] [[<platform>_]build_tree=/path/to/build-tree] [numjobs=n] [clean_first] [unfilter]
@@ -131,7 +131,7 @@ task :make do
       end
     end
   }
-  build_tree = ENV["#{platform}_build_tree"] || ENV['build_tree'] || "../#{platform}-Build"
+  build_tree = ENV["#{platform}_build_tree"] || ENV['build_tree'] || "build/#{platform}"
   if ENV['OS']
     # While calling mingw-32-make itself does not require the PATH to be altered (as long as it is not inside an MSYS shell),
     # we have to do it again here because our build system invokes CMake internally to generate things on-the-fly as part of the build process
@@ -192,7 +192,7 @@ task :android do
   avd = ENV['avd'] || "test_#{api}_#{abi}"
   retries = ENV['retries'] || 10 # minutes
   retry_interval = ENV['retry_interval'] || 10 # seconds
-  build_tree = ENV['android_build_tree'] || ENV['build_tree'] || '../android-Build'
+  build_tree = ENV['android_build_tree'] || ENV['build_tree'] || './android-Build'
   install = false
   ARGV.each { |option|
     task option.to_sym do ; end; Rake::Task[option].clear   # No-op hack
@@ -775,9 +775,9 @@ endif ()
 EOF
   # TODO: Rewrite in pure Ruby when it supports symlink creation on Windows platform and avoid forward/backward slash conversion
   if ENV['OS']
-    system("@echo off && mkdir \"#{dir}\"\\bin && copy Source\\Tools\\Urho3DPlayer\\Urho3DPlayer.* \"#{dir}\" >nul && (for %f in (*.bat Rakefile) do mklink \"#{dir}\"\\%f %cd%\\%f >nul) && mklink /D \"#{dir}\"\\CMake %cd%\\CMake && (for %d in (Autoload,CoreData,Data) do mklink /D \"#{dir}\"\\bin\\%d %cd%\\bin\\%d >nul)") && File.write("#{dir}/CMakeLists.txt", build_script) or abort 'Failed to scaffolding'
+    system("@echo off && mkdir \"#{dir}\"\\bin && copy Source\\Tools\\Urho3DPlayer\\Urho3DPlayer.* \"#{dir}\" >nul && (for %f in (script CMake) do mklink /D \"#{dir}\"\\%f %cd%\\%f >nul) && mklink \"#{dir}\"\\Rakefile %cd%\\Rakefile && (for %d in (Autoload,CoreData,Data) do mklink /D \"#{dir}\"\\bin\\%d %cd%\\bin\\%d >nul)") && File.write("#{dir}/CMakeLists.txt", build_script) or abort 'Failed to scaffolding'
   else
-    system("bash -c \"mkdir -p '#{dir}'/bin && cp Source/Tools/Urho3DPlayer/Urho3DPlayer.* '#{dir}' && for f in {.,}*.sh Rakefile CMake; do ln -sf `pwd`/\\$f '#{dir}'; done && ln -sf `pwd`/bin/{Autoload,CoreData,Data} '#{dir}'/bin\"") && File.write("#{dir}/CMakeLists.txt", build_script) or abort 'Failed to scaffolding'
+    system("bash -c \"mkdir -p '#{dir}'/bin && cp Source/Tools/Urho3DPlayer/Urho3DPlayer.* '#{dir}' && for f in script Rakefile CMake; do ln -snf `pwd`/\\$f '#{dir}'; done && ln -snf `pwd`/bin/{Autoload,CoreData,Data} '#{dir}'/bin\"") && File.write("#{dir}/CMakeLists.txt", build_script) or abort 'Failed to scaffolding'
   end
   return dir
 end

+ 0 - 0
.bash_helpers.sh → script/.bash_helpers.sh


+ 0 - 0
cmake_android.bat → script/cmake_android.bat


+ 0 - 0
cmake_android.sh → script/cmake_android.sh


+ 0 - 0
cmake_arm.sh → script/cmake_arm.sh


+ 0 - 0
cmake_clean.bat → script/cmake_clean.bat


+ 0 - 0
cmake_clean.sh → script/cmake_clean.sh


+ 0 - 0
cmake_codeblocks.bat → script/cmake_codeblocks.bat


+ 0 - 0
cmake_codeblocks.sh → script/cmake_codeblocks.sh


+ 23 - 23
cmake_codelite.bat → script/cmake_codelite.bat

@@ -1,23 +1,23 @@
-::
-:: Copyright (c) 2008-2018 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.
-::
-
-@"%~dp0cmake_generic.bat" %* -G "CodeLite - MinGW Makefiles"
+::
+:: Copyright (c) 2008-2018 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.
+::
+
+@"%~dp0cmake_generic.bat" %* -G "CodeLite - MinGW Makefiles"

+ 0 - 0
cmake_codelite.sh → script/cmake_codelite.sh


+ 0 - 0
cmake_eclipse.sh → script/cmake_eclipse.sh


+ 0 - 0
cmake_emscripten.bat → script/cmake_emscripten.bat


+ 0 - 0
cmake_emscripten.sh → script/cmake_emscripten.sh


+ 2 - 1
cmake_generic.bat → script/cmake_generic.bat

@@ -25,7 +25,8 @@
 :: Determine source tree and build tree
 setlocal
 set "SOURCE=%~dp0"
-set "SOURCE=%SOURCE:~0,-1%"
+set "SOURCE=%SOURCE:~0,-1%\.."
+set "SOURCE=%cd%"
 set "BUILD="
 if "%~1" == "" goto :continue
 set "ARG1=%~1"

+ 2 - 2
cmake_generic.sh → script/cmake_generic.sh

@@ -23,11 +23,11 @@
 
 # Determine source tree and build tree
 if [[ "$1" ]] && [[ ! "$1" =~ ^- ]]; then BUILD=$1; shift; elif [[ -f $(pwd)/CMakeCache.txt ]]; then BUILD=$(pwd); else caller=$(ps -o args= $PPID |cut -d' ' -f2); if [[ ! "$caller" =~ cmake_.*\.sh$ ]]; then caller=$0; fi; echo "Usage: ${caller##*/} /path/to/build-tree [build-options]"; exit 1; fi
-SOURCE=$(cd ${0%/*}; pwd)
+SOURCE=$(cd ${0%/*}/..; pwd)
 if [[ "$BUILD" == "." ]]; then BUILD=$(pwd); fi
 
 # Define helpers
-. "$SOURCE"/.bash_helpers.sh
+. "$SOURCE"/script/.bash_helpers.sh
 
 # Detect CMake toolchains directory if it is not provided explicitly
 [ "$TOOLCHAINS" == "" ] && TOOLCHAINS="$SOURCE"/CMake/Toolchains

+ 0 - 0
cmake_ios.sh → script/cmake_ios.sh


+ 0 - 0
cmake_mingw.bat → script/cmake_mingw.bat


+ 0 - 0
cmake_mingw.sh → script/cmake_mingw.sh


+ 0 - 0
cmake_ninja.bat → script/cmake_ninja.bat


+ 0 - 0
cmake_ninja.sh → script/cmake_ninja.sh


+ 0 - 0
cmake_rpi.sh → script/cmake_rpi.sh


+ 0 - 0
cmake_tvos.sh → script/cmake_tvos.sh


+ 0 - 0
cmake_vs2015.bat → script/cmake_vs2015.bat


+ 0 - 0
cmake_vs2017.bat → script/cmake_vs2017.bat


+ 0 - 0
cmake_xcode.sh → script/cmake_xcode.sh