Browse Source

Revert "Setup Android template directory for both Windows and non-Windows."

This reverts commit 06f7d73922f858b2c45bffcfdd7f602b8a9056a0.
Yao Wei Tjong 姚伟忠 12 năm trước cách đây
mục cha
commit
24c11dda23

+ 10 - 17
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -409,24 +409,17 @@ macro (add_android_native_init)
     elseif (EXISTS $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
         # Use Urho3D source installation
         list (APPEND SOURCE_FILES $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
+    elseif (EXISTS $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+        # Use Urho3D SDK installation on non-default installation location
+        list (APPEND SOURCE_FILES $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+    elseif (EXISTS ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+        # Use Urho3D SDK installation on system default installation location
+        list (APPEND SOURCE_FILES ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
     else ()
-        if (WIN32)
-            set (TEMPLATE_DIR "Urho3D SDK/Templates")
-        else ()
-            set (TEMPLATE_DIR share/Urho3D/Templates)
-        endif ()
-        if (EXISTS $ENV{URHO3D_INSTALL_PREFIX}/${TEMPLATE_DIR}/android/SDL_android_main.c)
-            # Use Urho3D SDK installation on non-default installation location
-            list (APPEND SOURCE_FILES $ENV{URHO3D_INSTALL_PREFIX}/${TEMPLATE_DIR}/android/SDL_android_main.c)
-        elseif (EXISTS ${CMAKE_INSTALL_PREFIX}/${TEMPLATE_DIR}/android/SDL_android_main.c)
-            # Use Urho3D SDK installation on system default installation location
-            list (APPEND SOURCE_FILES ${CMAKE_INSTALL_PREFIX}/${TEMPLATE_DIR}/android/SDL_android_main.c)
-        else ()
-            message (FATAL_ERROR
-                "Could not find SDL_android_main.c source file in default SDK installation location or Urho3D project root tree. "
-                "For searching in a non-default Urho3D SDK installation, use 'URHO3D_INSTALL_PREFIX' environment variable to specify the prefix path of the installation location. "
-                "For searching in a source tree of Urho3D project, use 'URHO3D_HOME' environment variable to specify the Urho3D project root directory.")
-        endif ()
+        message (FATAL_ERROR
+            "Could not find SDL_android_main.c source file in default SDK installation location or Urho3D project root tree. "
+            "For searching in a non-default Urho3D SDK installation, use 'URHO3D_INSTALL_PREFIX' environment variable to specify the prefix path of the installation location. "
+            "For searching in a source tree of Urho3D project, use 'URHO3D_HOME' environment variable to specify the Urho3D project root directory.")
     endif ()
 endmacro ()
 

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -108,7 +108,7 @@ set (SOURCE_FILES ${C_FILES} ${SYS_C_FILES} ${H_FILES})
 if (ANDROID)
     # Install dependency for SDL_android_main.c
     install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/SDL USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
-    install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_RUNTIME_DIR}/../Templates/android)
+    install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_RUNTIME_DIR}/templates/android)
 endif ()
 
 # Setup target