Install to standard locations using GNUInstallDirs
authorCraig Andrews <candrews@integralblue.com>
Tue, 30 Jul 2019 19:05:27 +0000 (15:05 -0400)
committerBen Ashbaugh <ben.ashbaugh@intel.com>
Tue, 6 Aug 2019 15:47:00 +0000 (08:47 -0700)
Different distributions may specify different paths; using GNUInstallDirs ensures that everything installed to the correct location for all systems. For example, amd64 Debian uses lib64 as opposed to lib, so hardcoding lib would be wrong for Debian.

CMakeLists.txt

index 768d30024d29cc4063caac43d24e1ba434733440..21da30d17a2df881714762685c0c0d43d79f7ec3 100644 (file)
@@ -1,6 +1,7 @@
 cmake_minimum_required (VERSION 2.8.11)
 
 project (OPENCL_ICD_LOADER)
+include (GNUInstallDirs)
 find_package (Threads REQUIRED)
 
 # The option below allows building the ICD Loader library as a shared library
@@ -131,6 +132,6 @@ if (BUILD_TESTING)
 endif()
 
 install (TARGETS OpenCL
-    RUNTIME DESTINATION bin
-    ARCHIVE DESTINATION lib
-    LIBRARY DESTINATION lib)
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})