Browse Source

Fixed condition expression in post-cmake() function.

Wei Tjong Yao 12 years ago
parent
commit
0ff4759eba
2 changed files with 8 additions and 5 deletions
  1. 2 1
      Source/CMake/Modules/Urho3D-CMake-magic.cmake
  2. 6 4
      cmake_gcc.sh

+ 2 - 1
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -440,7 +440,8 @@ macro (adjust_library_name)
 endmacro ()
 
 # Macro for defining external library dependencies
-# The purpose of this macro is emulate CMake to set the external library dependencies transitively to a main target setup but in other project's CMake build script that uses Urho3D static/shared library 
+# The purpose of this macro is emulate CMake to set the external library dependencies transitively
+# It works for both targets setup within Urho3D project and outside Urho3D project that uses Urho3D as external static/shared library 
 macro (define_dependency_libs TARGET)
     # ThirdParty/SDL external dependency
     if (${TARGET} MATCHES SDL|Main)

+ 6 - 4
cmake_gcc.sh

@@ -28,7 +28,7 @@ msg() {
 post_cmake() {
     # Check if xmlstarlet software package is available for fixing the generated Eclipse project setting
     if [ $HAS_XMLSTARLET ]; then
-        if [ $ANDROID_NDK ]; then
+        if [ $1 == "android-Build" ]; then
             # 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
@@ -54,9 +54,11 @@ post_cmake() {
                     $1/.project
             done
 
-        elif [ $RASPI_TOOL]; then
-            # For Raspberry Pi build, do nothing
-            :
+        elif [ $1 == "raspi-Build" ]; then
+            # For Raspberry Pi build, just remove build type from project name
+            xmlstarlet ed -P -L \
+                -u "/projectDescription/name/text()" -x "concat(substring-before(/projectDescription/name/text(), '-Release'), substring-before(/projectDescription/name/text(), '-Debug'), substring-before(/projectDescription/name/text(), '-RelWithDebInfo'))" \
+                $1/.project
 
         else
             # For native build, move the Eclipse project setting files back to Source folder to fix source code versioning