wxWidgets hardcodes libdir with 'lib' and does not support multilib which will
change it. Respect variable wxPLATFORM_LIB_DIR to support libdir be configurable.

Upstream-Status: Pending

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4063020552..253d415210 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,7 @@ include(build/cmake/policies.cmake NO_POLICY_SCOPE)
 # Initialize variables for quick access to wx root dir in sub dirs
 set(wxSOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(wxBINARY_DIR ${CMAKE_BINARY_DIR})
-set(wxOUTPUT_DIR ${wxBINARY_DIR}/lib)
+set(wxOUTPUT_DIR ${wxBINARY_DIR}/lib${wxPLATFORM_LIB_DIR})
 
 # parse the version number from wx/version.h and include in wxMAJOR_VERSION and wxMINOR_VERSION
 file(READ include/wx/version.h WX_VERSION_H_CONTENTS)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 91d11acba2..f361d50a27 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -57,7 +57,7 @@ function(wx_write_config_inplace)
     execute_process(
         COMMAND
         ${CMAKE_COMMAND} -E create_symlink
-        "lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}"
+        "lib${wxPLATFORM_LIB_DIR}/wx/config/inplace-${TOOLCHAIN_FULLNAME}"
         "${CMAKE_CURRENT_BINARY_DIR}/wx-config"
         )
 endfunction()
diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake
index c33dd3946c..51e47e05b3 100644
--- a/build/cmake/functions.cmake
+++ b/build/cmake/functions.cmake
@@ -78,9 +78,9 @@ function(wx_set_common_target_properties target_name)
     cmake_parse_arguments(wxCOMMON_TARGET_PROPS "DEFAULT_WARNINGS" "" "" ${ARGN})
 
     set_target_properties(${target_name} PROPERTIES
-        LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}"
-        ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}"
-        RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}"
+        LIBRARY_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}"
+        ARCHIVE_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}"
+        RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}"
         )
 
     if(wxBUILD_PIC)
diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake
index 968dff859e..c850c51844 100644
--- a/build/cmake/install.cmake
+++ b/build/cmake/install.cmake
@@ -33,11 +33,11 @@ if(MSVC)
 else()
     wx_install(
         DIRECTORY "${wxSETUP_HEADER_PATH}"
-        DESTINATION "lib/wx/include")
+        DESTINATION "lib${wxPLATFORM_LIB_DIR}/wx/include")
 
     wx_install(
         FILES "${wxOUTPUT_DIR}/wx/config/${wxBUILD_FILE_ID}"
-        DESTINATION "lib/wx/config"
+        DESTINATION "lib${wxPLATFORM_LIB_DIR}/wx/config"
         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
                     GROUP_EXECUTE GROUP_READ
                     WORLD_EXECUTE WORLD_READ
@@ -46,7 +46,7 @@ else()
     install(DIRECTORY DESTINATION "bin")
     install(CODE "execute_process( \
         COMMAND ${CMAKE_COMMAND} -E create_symlink \
-        ${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} \
+        ${CMAKE_INSTALL_PREFIX}/lib${wxPLATFORM_LIB_DIR}/wx/config/${wxBUILD_FILE_ID} \
         ${CMAKE_INSTALL_PREFIX}/bin/wx-config \
         )"
     )
