瀏覽代碼

Merge branch 'freebsd-compat' of https://github.com/tony/oxygine-framework into test

dmuratshin 10 年之前
父節點
當前提交
1b061bf510
共有 60 個文件被更改,包括 317 次插入173 次删除
  1. 39 60
      CMakeLists.txt
  2. 168 3
      cmake/FindSDL2.cmake
  3. 1 1
      examples/Demo/prepare_res.sh
  4. 1 1
      examples/Demo/prepare_res_pvrtc.sh
  5. 1 1
      examples/Demo/prepare_res_pvrtc_high_quality.sh
  6. 2 2
      examples/Demo/proj.android/ant_debug.sh
  7. 2 2
      examples/Demo/proj.android/build-run.sh
  8. 2 2
      examples/Demo/proj.android/build.sh
  9. 2 2
      examples/Demo/proj.android/install.sh
  10. 2 2
      examples/Demo/proj.cmake/run.sh
  11. 2 2
      examples/DemoBox2D/proj.android/ant_debug.sh
  12. 2 2
      examples/DemoBox2D/proj.android/build-run.sh
  13. 2 2
      examples/DemoBox2D/proj.android/build.sh
  14. 2 2
      examples/DemoBox2D/proj.android/install.sh
  15. 2 2
      examples/DemoBox2D/proj.cmake/run.sh
  16. 2 2
      examples/Game/part1/proj.android/ant_debug.sh
  17. 2 2
      examples/Game/part1/proj.android/build-run.sh
  18. 2 2
      examples/Game/part1/proj.android/build.sh
  19. 2 2
      examples/Game/part1/proj.android/install.sh
  20. 2 2
      examples/Game/part1/proj.cmake/CMakeLists.txt
  21. 2 2
      examples/Game/part1/proj.cmake/run.sh
  22. 2 2
      examples/Game/part2/proj.android/ant_debug.sh
  23. 2 2
      examples/Game/part2/proj.android/build-run.sh
  24. 2 2
      examples/Game/part2/proj.android/build.sh
  25. 2 2
      examples/Game/part2/proj.android/install.sh
  26. 2 2
      examples/Game/part2/proj.cmake/run.sh
  27. 2 2
      examples/Game/part3/proj.android/ant_debug.sh
  28. 2 2
      examples/Game/part3/proj.android/build-run.sh
  29. 2 2
      examples/Game/part3/proj.android/build.sh
  30. 2 2
      examples/Game/part3/proj.android/install.sh
  31. 2 2
      examples/Game/part3/proj.cmake/run.sh
  32. 2 2
      examples/Game/part4/proj.android/ant_debug.sh
  33. 2 2
      examples/Game/part4/proj.android/build-run.sh
  34. 2 2
      examples/Game/part4/proj.android/build.sh
  35. 2 2
      examples/Game/part4/proj.android/install.sh
  36. 2 2
      examples/Game/part4/proj.cmake/run.sh
  37. 2 2
      examples/Game/part5/gen-atlasses-android(ETC1).sh
  38. 2 2
      examples/Game/part5/gen-atlasses-ios(PVRTC).sh
  39. 1 1
      examples/Game/part5/gen-atlasses-low-definition.sh
  40. 1 1
      examples/Game/part5/gen-atlasses.sh
  41. 2 2
      examples/Game/part5/proj.android/ant_debug.sh
  42. 2 2
      examples/Game/part5/proj.android/build-run.sh
  43. 2 2
      examples/Game/part5/proj.android/build.sh
  44. 2 2
      examples/Game/part5/proj.android/install.sh
  45. 2 2
      examples/Game/part5/proj.cmake/run.sh
  46. 2 2
      examples/HelloWorld/proj.android/ant_debug.sh
  47. 2 2
      examples/HelloWorld/proj.android/build-run.sh
  48. 2 2
      examples/HelloWorld/proj.android/build.sh
  49. 2 2
      examples/HelloWorld/proj.android/install.sh
  50. 2 2
      examples/HelloWorld/proj.cmake/run.sh
  51. 2 2
      examples/Match3/proj.android/ant_debug.sh
  52. 2 2
      examples/Match3/proj.android/build-run.sh
  53. 2 2
      examples/Match3/proj.android/build.sh
  54. 2 2
      examples/Match3/proj.android/install.sh
  55. 1 1
      examples/Match3/proj.cmake/run.sh
  56. 2 2
      tools/templates/proj.android/ant_debug.sh
  57. 2 2
      tools/templates/proj.android/build-run.sh
  58. 2 2
      tools/templates/proj.android/build.sh
  59. 2 2
      tools/templates/proj.android/install.sh
  60. 2 2
      tools/templates/proj.cmake/run.sh

+ 39 - 60
CMakeLists.txt

@@ -1,29 +1,19 @@
 cmake_minimum_required (VERSION 2.6)
 project (OXYGINE)
 
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
 
 if (WIN32)
 	set(OX_DEFINITIONS	${OX_DEFINITIONS}
 		-D_CRT_SECURE_NO_WARNINGS)
-	set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)
 else(WIN32)
-	find_path(SDL2_INCLUDE_DIRS NAMES SDL2/SDL.h)
-	message(STATUS ${SDL2_INCLUDE_DIRS_FOUND})
-
-	if (SDL2_INCLUDE_DIRS)		
-		set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS}/SDL2)
-		message(STATUS "found")		
-	else()
-		message(STATUS "SDL notfound")
-		set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)					
-	endif()
-
 	find_package(CURL)
-
 endif(WIN32)
 
+find_package(SDL2 REQUIRED)
+include_directories(${SDL2_INCLUDE_DIR})
 
 set(OX_HAVE_LIBJPEG 1)
 set(OX_HAVE_LIBPNG 1)
@@ -81,10 +71,42 @@ foreach(F ${FOLDERS})
 endforeach(F)
 
 
+find_package(OpenGL REQUIRED)
+
+#add png library
+if (OX_HAVE_LIBPNG)
+	find_package(PNG REQUIRED)
+	set (CORE_LIBS
+		${CORE_LIBS}
+		${PNG_LIBRARIES}
+	)
+	include_directories(
+		${PNG_INCLUDE_DIR}
+	)
+	set(OX_DEFINITIONS	${OX_DEFINITIONS}
+		-DOX_HAVE_LIBPNG)
+endif(OX_HAVE_LIBPNG)
+
+#add jpeg library
+if (OX_HAVE_LIBJPEG)
+	find_package(JPEG REQUIRED)
+	set (CORE_LIBS
+		${CORE_LIBS}
+		${JPEG_LIBRARIES}
+	)
+	include_directories(
+		${JPEG_INCLUDE_DIR}
+	)
+	set(OX_DEFINITIONS	${OX_DEFINITIONS}
+		-DOX_HAVE_LIBJPEG)
+endif(OX_HAVE_LIBJPEG)
 
 set(OXYGINE_INCLUDE_DIRS 
 	${OXYGINE_ROOT_SRC}
-	${SDL2_INCLUDE_DIRS}
+	${SDL2_INCLUDE_DIR}
+	${OPENGL_INCLUDE_DIR}
+	${PNG_INCLUDE_DIR}
+	${JPEG_INCLUDE_DIR}
 	${THIRD_PARTY}/pthreads/include/
 	${THIRD_PARTY}/zlib)
 
@@ -92,13 +114,6 @@ set(OXYGINE_INCLUDE_DIRS
 include_directories(${OXYGINE_INCLUDE_DIRS})
 
 
-find_package(OpenGL)
-include_directories(
-	${THIRD_PARTY}/libjpeg
-	${THIRD_PARTY}/libpng
-	)
-
-
 set(OXYGINE_LIBRARY_DIRS
 	${OXYGINE_LIBRARY_DIRS}
 	${OXYGINE_SOURCE_DIR}/libs
@@ -117,9 +132,9 @@ endif(MINGW)
 set(CORE_LIBS 
 	${CORE_LIBS}
 	oxygine-framework
-	SDL2main	
-	SDL2	
-	${OPENGL_LIBRARIES}		
+	${OPENGL_LIBRARIES}
+	${SDL2_LIBRARY}
+
 )
 
 if (WIN32)
@@ -140,25 +155,6 @@ else(WIN32)
 endif(WIN32)
 
 
-#add png library
-if (OX_HAVE_LIBPNG)
-
-	set(LIBPNG ${libprefix}png)
-
-	if (MSVC)
-		if (MSVC_VERSION EQUAL "1900")
-			set(LIBPNG ${LIBPNG}-2015)
-		endif()
-	endif()	
-
-	set(CORE_LIBS
-		${CORE_LIBS}
-		${LIBPNG})
-
-	set(OX_DEFINITIONS	${OX_DEFINITIONS}
-		-DOX_HAVE_LIBPNG)
-endif(OX_HAVE_LIBPNG)
-
 #add z library
 if (EMSCRIPTEN)
 	set(CORE_LIBS
@@ -175,23 +171,6 @@ endif(EMSCRIPTEN)
 
 #message(STATUS ${CORE_LIBS})
 
-#add jpeg library
-if (OX_HAVE_LIBJPEG)
-	set(LIBJPEG ${libprefix}jpeg)
-
-	if (MSVC)
-		if (MSVC_VERSION EQUAL "1900")
-			set(LIBJPEG ${LIBJPEG}-2015)
-		endif()	
-	endif()	
-
-	set(OX_DEFINITIONS	${OX_DEFINITIONS}
-		-DOX_HAVE_LIBJPEG)
-	set(CORE_LIBS
-		${CORE_LIBS}
-		${LIBJPEG})
-endif(OX_HAVE_LIBJPEG)
-
 
 if (OX_HAVE_LIBCURL)
 	set(OX_DEFINITIONS ${OX_DEFINITIONS}

+ 168 - 3
cmake/FindSDL2.cmake

@@ -1,3 +1,168 @@
-SET(SDL2_FOUND TRUE)
-set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../sdl/include)
-set(SDL2_LIBRARIES sdl2)
+# This module defines
+# SDL2_LIBRARY, the name of the library to link against
+# SDL2_FOUND, if false, do not try to link to SDL2
+# SDL2_INCLUDE_DIR, where to find SDL.h
+#
+# This module responds to the the flag:
+# SDL2_BUILDING_LIBRARY
+# If this is defined, then no SDL2main will be linked in because
+# only applications need main().
+# Otherwise, it is assumed you are building an application and this
+# module will attempt to locate and set the the proper link flags
+# as part of the returned SDL2_LIBRARY variable.
+#
+# Don't forget to include SDLmain.h and SDLmain.m your project for the
+# OS X framework based version. (Other versions link to -lSDL2main which
+# this module will try to find on your behalf.) Also for OS X, this
+# module will automatically add the -framework Cocoa on your behalf.
+#
+#
+# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
+# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
+# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
+# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
+# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
+# as appropriate. These values are used to generate the final SDL2_LIBRARY
+# variable, but when these values are unset, SDL2_LIBRARY does not get created.
+#
+#
+# $SDL2DIR is an environment variable that would
+# correspond to the ./configure --prefix=$SDL2DIR
+# used in building SDL2.
+# l.e.galup  9-20-02
+#
+# Modified by Eric Wing.
+# Added code to assist with automated building by using environmental variables
+# and providing a more controlled/consistent search behavior.
+# Added new modifications to recognize OS X frameworks and
+# additional Unix paths (FreeBSD, etc).
+# Also corrected the header search path to follow "proper" SDL guidelines.
+# Added a search for SDL2main which is needed by some platforms.
+# Added a search for threads which is needed by some platforms.
+# Added needed compile switches for MinGW.
+#
+# On OSX, this will prefer the Framework version (if found) over others.
+# People will have to manually change the cache values of
+# SDL2_LIBRARY to override this selection or set the CMake environment
+# CMAKE_INCLUDE_PATH to modify the search paths.
+#
+# Note that the header path has changed from SDL2/SDL.h to just SDL.h
+# This needed to change because "proper" SDL convention
+# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
+# reasons because not all systems place things in SDL2/ (see FreeBSD).
+
+#=============================================================================
+# Copyright 2003-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+message("<FindSDL2.cmake>")
+
+SET(SDL2_SEARCH_PATHS
+	~/Library/Frameworks
+	/Library/Frameworks
+	/usr/local
+	/usr
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	${SDL2_PATH}
+)
+
+FIND_PATH(SDL2_INCLUDE_DIR SDL.h
+	HINTS
+	$ENV{SDL2DIR}
+	PATH_SUFFIXES include/SDL2 include
+	PATHS ${SDL2_SEARCH_PATHS}
+)
+
+FIND_LIBRARY(SDL2_LIBRARY_TEMP
+	NAMES SDL2
+	HINTS
+	$ENV{SDL2DIR}
+	PATH_SUFFIXES lib64 lib
+	PATHS ${SDL2_SEARCH_PATHS}
+)
+
+IF(NOT SDL2_BUILDING_LIBRARY)
+	IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
+		# Non-OS X framework versions expect you to also dynamically link to
+		# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
+		# seem to provide SDL2main for compatibility even though they don't
+		# necessarily need it.
+		FIND_LIBRARY(SDL2MAIN_LIBRARY
+			NAMES SDL2main
+			HINTS
+			$ENV{SDL2DIR}
+			PATH_SUFFIXES lib64 lib
+			PATHS ${SDL2_SEARCH_PATHS}
+		)
+	ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
+ENDIF(NOT SDL2_BUILDING_LIBRARY)
+
+# SDL2 may require threads on your system.
+# The Apple build may not need an explicit flag because one of the
+# frameworks may already provide it.
+# But for non-OSX systems, I will use the CMake Threads package.
+IF(NOT APPLE)
+	FIND_PACKAGE(Threads)
+ENDIF(NOT APPLE)
+
+# MinGW needs an additional library, mwindows
+# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
+# (Actually on second look, I think it only needs one of the m* libraries.)
+IF(MINGW)
+	SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
+ENDIF(MINGW)
+
+IF(SDL2_LIBRARY_TEMP)
+	# For SDL2main
+	IF(NOT SDL2_BUILDING_LIBRARY)
+		IF(SDL2MAIN_LIBRARY)
+			SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
+		ENDIF(SDL2MAIN_LIBRARY)
+	ENDIF(NOT SDL2_BUILDING_LIBRARY)
+
+	# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
+	# CMake doesn't display the -framework Cocoa string in the UI even
+	# though it actually is there if I modify a pre-used variable.
+	# I think it has something to do with the CACHE STRING.
+	# So I use a temporary variable until the end so I can set the
+	# "real" variable in one-shot.
+	IF(APPLE)
+		SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
+	ENDIF(APPLE)
+
+	# For threads, as mentioned Apple doesn't need this.
+	# In fact, there seems to be a problem if I used the Threads package
+	# and try using this line, so I'm just skipping it entirely for OS X.
+	IF(NOT APPLE)
+		SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
+	ENDIF(NOT APPLE)
+
+	# For MinGW library
+	IF(MINGW)
+		SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
+	ENDIF(MINGW)
+
+	# Set the final string here so the GUI reflects the final state.
+	SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
+	# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
+	SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
+ENDIF(SDL2_LIBRARY_TEMP)
+
+message("</FindSDL2.cmake>")
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
+

+ 1 - 1
examples/Demo/prepare_res.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env sh
 python ../../tools/oxyresbuild.py -x xmls/res.xml --src_data data --dest_data data

+ 1 - 1
examples/Demo/prepare_res_pvrtc.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env sh
 python ../../tools/oxyresbuild.py -x xmls/res.xml --src_data data --dest_data data --compress pvrtc

+ 1 - 1
examples/Demo/prepare_res_pvrtc_high_quality.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env sh
 python ../../tools/oxyresbuild.py -x xmls/res.xml --src_data data --dest_data data --compress pvrtc -q best

+ 2 - 2
examples/Demo/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Demo/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Demo/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../ $@

+ 2 - 2
examples/Demo/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/Demo-debug.apk
-adb shell am start -n org.oxygine.Demo/org.oxygine.Demo.MainActivity
+adb shell am start -n org.oxygine.Demo/org.oxygine.Demo.MainActivity

+ 2 - 2
examples/Demo/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/Demo
+./../proj.cmake/build/Demo

+ 2 - 2
examples/DemoBox2D/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/DemoBox2D/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/DemoBox2D/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../ $@

+ 2 - 2
examples/DemoBox2D/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/DemoBox2D-debug.apk
-adb shell am start -n org.oxygine.DemoBox2D/org.oxygine.DemoBox2D.MainActivity
+adb shell am start -n org.oxygine.DemoBox2D/org.oxygine.DemoBox2D.MainActivity

+ 2 - 2
examples/DemoBox2D/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/DemoBox2D
+./../proj.cmake/build/DemoBox2D

+ 2 - 2
examples/Game/part1/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Game/part1/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Game/part1/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../../ $@

+ 2 - 2
examples/Game/part1/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/GamePart1-debug.apk
-adb shell am start -n org.oxygine.GamePart1/org.oxygine.GamePart1.MainActivity
+adb shell am start -n org.oxygine.GamePart1/org.oxygine.GamePart1.MainActivity

+ 2 - 2
examples/Game/part1/proj.cmake/CMakeLists.txt

@@ -6,11 +6,11 @@ add_definitions(${OXYGINE_DEFINITIONS})
 include_directories(${OXYGINE_INCLUDE_DIRS})
 link_directories(${OXYGINE_LIBRARY_DIRS})
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wswitch")
 add_executable(GamePart1 ../src/Game.cpp ../src/Joystick.cpp ../src/Player.cpp ../src/Unit.cpp ../src/entry_point.cpp ../src/example.cpp ../src/res.cpp  ../src/Game.h ../src/Joystick.h ../src/Player.h ../src/Unit.h ../src/example.h ../src/res.h )
 
 if (WIN32) #disable console mode for VC++
 	set_target_properties(GamePart1 PROPERTIES WIN32_EXECUTABLE TRUE)
 endif(WIN32)
 
-target_link_libraries(GamePart1 ${OXYGINE_CORE_LIBS})
+target_link_libraries(GamePart1 ${OXYGINE_CORE_LIBS})

+ 2 - 2
examples/Game/part1/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/GamePart1
+./../proj.cmake/build/GamePart1

+ 2 - 2
examples/Game/part2/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Game/part2/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Game/part2/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../../ $@

+ 2 - 2
examples/Game/part2/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/GamePart2-debug.apk
-adb shell am start -n org.oxygine.GamePart2/org.oxygine.GamePart2.MainActivity
+adb shell am start -n org.oxygine.GamePart2/org.oxygine.GamePart2.MainActivity

+ 2 - 2
examples/Game/part2/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/GamePart2
+./../proj.cmake/build/GamePart2

+ 2 - 2
examples/Game/part3/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Game/part3/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Game/part3/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../../ $@

+ 2 - 2
examples/Game/part3/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/GamePart3-debug.apk
-adb shell am start -n org.oxygine.GamePart3/org.oxygine.GamePart3.MainActivity
+adb shell am start -n org.oxygine.GamePart3/org.oxygine.GamePart3.MainActivity

+ 2 - 2
examples/Game/part3/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/GamePart3
+./../proj.cmake/build/GamePart3

+ 2 - 2
examples/Game/part4/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Game/part4/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Game/part4/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../../ $@

+ 2 - 2
examples/Game/part4/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/GamePart4-debug.apk
-adb shell am start -n org.oxygine.GamePart4/org.oxygine.GamePart4.MainActivity
+adb shell am start -n org.oxygine.GamePart4/org.oxygine.GamePart4.MainActivity

+ 2 - 2
examples/Game/part4/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/GamePart4
+./../proj.cmake/build/GamePart4

+ 2 - 2
examples/Game/part5/gen-atlasses-android(ETC1).sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data --compress etc1
+#!/usr/bin/env sh
+python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data --compress etc1

+ 2 - 2
examples/Game/part5/gen-atlasses-ios(PVRTC).sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data --compress pvrtc --quality best
+#!/usr/bin/env sh
+python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data --compress pvrtc --quality best

+ 1 - 1
examples/Game/part5/gen-atlasses-low-definition.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env sh
 python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data -s 0.5 -r

+ 1 - 1
examples/Game/part5/gen-atlasses.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env sh
 python ../../../tools/oxyresbuild.py -x xmls/ui.xml --src_data data --dest_data data

+ 2 - 2
examples/Game/part5/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Game/part5/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Game/part5/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../../ $@

+ 2 - 2
examples/Game/part5/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/GamePart5-debug.apk
-adb shell am start -n org.oxygine.GamePart5/org.oxygine.GamePart5.MainActivity
+adb shell am start -n org.oxygine.GamePart5/org.oxygine.GamePart5.MainActivity

+ 2 - 2
examples/Game/part5/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/GamePart5
+./../proj.cmake/build/GamePart5

+ 2 - 2
examples/HelloWorld/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/HelloWorld/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/HelloWorld/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../ $@

+ 2 - 2
examples/HelloWorld/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/HelloWorld-debug.apk
-adb shell am start -n org.oxygine.HelloWorld/org.oxygine.HelloWorld.MainActivity
+adb shell am start -n org.oxygine.HelloWorld/org.oxygine.HelloWorld.MainActivity

+ 2 - 2
examples/HelloWorld/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/HelloWorld
+./../proj.cmake/build/HelloWorld

+ 2 - 2
examples/Match3/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
examples/Match3/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
examples/Match3/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=../../../../ $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=../../../../ $@

+ 2 - 2
examples/Match3/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/Match3-debug.apk
-adb shell am start -n org.oxygine.Match3/org.oxygine.Match3.MainActivity
+adb shell am start -n org.oxygine.Match3/org.oxygine.Match3.MainActivity

+ 1 - 1
examples/Match3/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build

+ 2 - 2
tools/templates/proj.android/ant_debug.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ant debug
+#!/usr/bin/env sh
+ant debug

+ 2 - 2
tools/templates/proj.android/build-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 sh build.sh
 sh ant_debug.sh
-sh install.sh
+sh install.sh

+ 2 - 2
tools/templates/proj.android/build.sh

@@ -1,2 +1,2 @@
-#!/bin/bash
-ndk-build NDK_MODULE_PATH=${ROOT} $@
+#!/usr/bin/env sh
+ndk-build NDK_MODULE_PATH=${ROOT} $@

+ 2 - 2
tools/templates/proj.android/install.sh

@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env sh
 adb install -r bin/${PROJECT}-debug.apk
-adb shell am start -n org.oxygine.${PROJECT}/org.oxygine.${PROJECT}.MainActivity
+adb shell am start -n org.oxygine.${PROJECT}/org.oxygine.${PROJECT}.MainActivity

+ 2 - 2
tools/templates/proj.cmake/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env sh
 
 mkdir build
 cd build
@@ -13,4 +13,4 @@ make
 cd ../../data
 
 #run executable
-./../proj.cmake/build/${PROJECT}
+./../proj.cmake/build/${PROJECT}