Author: Flavien Bridault <fbridault@ircad.fr>
Description: Use proper arch dependent library dir
Bug: https://github.com/IRCAD/camp/issues/2

--- camp.orig/CMakeLists.txt
+++ camp/CMakeLists.txt
@@ -39,6 +39,8 @@
 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
+include(GNUInstallDirs)
+
 # include project configuration
 include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake)
 include(${CMAKE_SOURCE_DIR}/cmake/PackageFilename.cmake)
@@ -201,7 +203,7 @@
 
 configure_package_config_file(cmake/CAMPConfig.cmake.in
     ${CMAKE_CURRENT_BINARY_DIR}/CAMPConfig.cmake
-    INSTALL_DESTINATION lib/camp/cmake
+    INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/camp
 )
 
 write_basic_package_version_file(
@@ -226,24 +228,24 @@
 
 install(TARGETS camp
     EXPORT CAMPTargets
-    RUNTIME DESTINATION bin COMPONENT bin
-    LIBRARY DESTINATION lib COMPONENT bin
-    ARCHIVE DESTINATION lib COMPONENT devel
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT bin
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
 )
 
 install(FILES ${CMAKE_BINARY_DIR}/camp.pc
-    DESTINATION lib/pkgconfig
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
     COMPONENT devel
 )
 
 install(EXPORT CAMPTargets
     NAMESPACE camp::
-    DESTINATION lib/camp/cmake
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/camp
     COMPONENT devel
 )
 
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CAMPConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/CAMPConfigVersion.cmake
-    DESTINATION lib/camp/cmake
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/camp
     COMPONENT devel
 )
 
