Consolidate the installation paths and make sure we have decent defaults.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4873 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed1975b..dd03a5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,22 @@
 # The RC version must always be four comma-separated numbers
 set(RCVERSION 1,2,80,0)
 
+# Installation paths
+set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share")
+set(MAN_DIR "${DATA_DIR}/man")
+set(LOCALE_DIR "${DATA_DIR}/locale")
+set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${VERSION}")
+
+if(WIN32)
+set(BIN_DIR "${CMAKE_INSTALL_PREFIX}")
+set(DOC_DIR "${CMAKE_INSTALL_PREFIX}")
+endif()
+
 # Compatibility variables for the migration from autotools
 add_definitions(-DPACKAGE_NAME="${CMAKE_PROJECT_NAME}")
 add_definitions(-DPACKAGE_VERSION="${VERSION}")
-add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/locale")
+add_definitions(-DLOCALEDIR="${LOCALE_DIR}")
 
 if(MSVC)
   message(FATAL_ERROR "TigerVNC cannot be built with Visual Studio.  Please use MinGW")
@@ -162,7 +174,6 @@
 if(ENABLE_NLS)
   # Tools
   find_package(Gettext)
-  set(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale")
 
   # Gettext needs iconv
   find_package(Iconv)