THRIFT-5109 Misc Cmake build improvements
Patch: Mario Emmenlauer

This closes #2017
This closes #2018
This closes #2019

- build/cmake/DefineInstallationPaths.cmake: fixed the library path
- build/cmake/ThriftMacros.cmake: do not enforce debug suffix 'd'
- lib/java/CMakeLists.txt: allow to override JAVA_INSTALL_DIR
diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake
index 0c824cc..23962b4 100644
--- a/build/cmake/DefineInstallationPaths.cmake
+++ b/build/cmake/DefineInstallationPaths.cmake
@@ -20,7 +20,11 @@
 
 # Define the default install paths
 set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
-set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
+if(MSVC)
+    set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})")
+else()
+    set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
+endif()
 set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
 set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
 set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)")