diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 06256b1..2960a31 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -66,7 +66,7 @@ else()
     set(wxCOMPILER_PREFIX)
 endif()
 
-if(MSVC OR MINGW)
+if((MSVC OR MINGW) AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR)
     if(wxBUILD_SHARED)
         set(lib_suffix "dll")
     else()
