There are errors during do install. So link files 'wx-config' and 'wxrc' are
not created, and rename failed either:

| CMake Error: failed to create symbolic link '/usr/bin/wx-config': Permission denied
| Error renaming from "/usr/bin/wxrc" to "/usr/bin/wxrc-3.1": No such file or directory
| CMake Error: failed to create symbolic link '/usr/bin/wxrc': Permission denied

Respect variable 'DESTDIR' to make it work as expect.

Upstream-Status: Pending

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 build/cmake/install.cmake        | 4 ++--
 build/cmake/utils/CMakeLists.txt | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
index c850c51844..5cbc67daa1 100644
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -46,8 +46,8 @@ else()
     install(DIRECTORY DESTINATION "bin")
     install(CODE "execute_process( \
         COMMAND ${CMAKE_COMMAND} -E create_symlink \
-        ${CMAKE_INSTALL_PREFIX}/lib${wxPLATFORM_LIB_DIR}/wx/config/${wxBUILD_FILE_ID} \
-        ${CMAKE_INSTALL_PREFIX}/bin/wx-config \
+        ../lib${wxPLATFORM_LIB_DIR}/wx/config/${wxBUILD_FILE_ID} \
+        \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wx-config \
         )"
     )
 endif()
diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt
index 4108d6a723..fbac6bb533 100644
--- a/build/cmake/utils/CMakeLists.txt
+++ b/build/cmake/utils/CMakeLists.txt
@@ -34,14 +34,14 @@ if(wxUSE_XRC)
     if(NOT MSVC)
         install(CODE "execute_process( \
             COMMAND ${CMAKE_COMMAND} -E rename \
-            ${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
-            ${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
+            \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
+            \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
             )"
         )
         install(CODE "execute_process( \
             COMMAND ${CMAKE_COMMAND} -E create_symlink \
-            ${CMAKE_INSTALL_PREFIX}/bin/wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
-            ${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
+            wxrc-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${EXE_SUFFIX} \
+            \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX} \
             )"
         )
     endif()
