Description: Add user customizable install paths.
Author: YunQiang Su <wzssyqa@gmail.com>
Forwarded: https://github.com/jklimke/libcitygml/pull/15

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,28 @@ SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/
 MAKE_DIRECTORY(${OUTPUT_LIBDIR})
 SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
 
+if(NOT DEFINED BIN_INSTALL_DIR)
+    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT DEFINED BIN_INSTALL_DIR)
+if(NOT DEFINED LIB_INSTALL_DIR)
+    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT DEFINED LIB_INSTALL_DIR)
+if(NOT DEFINED DATA_INSTALL_DIR)
+    set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
+endif(NOT DEFINED DATA_INSTALL_DIR)
+if(NOT DEFINED INCLUDE_INSTALL_DIR)
+    set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/citygml")
+endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+if(NOT DEFINED MAN_INSTALL_DIR)
+    set(MAN_INSTALL_DIR "${DATA_INSTALL_DIR}/man")
+endif(NOT DEFINED MAN_INSTALL_DIR)
+if(NOT DEFINED RESOURCE_INSTALL_DIR)
+    set(RESOURCE_INSTALL_DIR "${DATA_INSTALL_DIR}/libcitygml${META_VERSION_MAJOR}/resource/")
+endif(NOT DEFINED RESOURCE_INSTALL_DIR)
+if(NOT DEFINED LOCALE_INSTALL_DIR)
+    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale/")
+endif(NOT DEFINED LOCALE_INSTALL_DIR)
+
 # IF( DEBUG_BUILD )
   # SET( CMAKE_BUILD_TYPE "Debug" )
 # ELSE( DEBUG_BUILD )
--- a/sources/CMakeLists.txt
+++ b/sources/CMakeLists.txt
@@ -153,13 +153,13 @@ TARGET_LINK_LIBRARIES( ${target} ${XERCE
 
 INSTALL(
     TARGETS ${target}
-    RUNTIME DESTINATION bin
-    LIBRARY DESTINATION lib
-    ARCHIVE DESTINATION lib
+    RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+    LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
 )
 # FIXME: Do not run for OS X framework
 INSTALL(
     FILES        ${PUBLIC_HEADER}
-    DESTINATION  ${CMAKE_INSTALL_PREFIX}/include/${target}
+    DESTINATION  ${INCLUDE_INSTALL_DIR}
 )
 
