[libclc] r350565 - cmake: Install libraries to DATADIR from GNUInstallDirs
Jan Vesely via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 7 12:20:38 PST 2019
Author: jvesely
Date: Mon Jan 7 12:20:37 2019
New Revision: 350565
URL: http://llvm.org/viewvc/llvm-project?rev=350565&view=rev
Log:
cmake: Install libraries to DATADIR from GNUInstallDirs
This moves default installation location to /usr/share to match libclc.pc.
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewer: Tom Stellard
Modified:
libclc/trunk/CMakeLists.txt
libclc/trunk/libclc.pc.in
Modified: libclc/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/CMakeLists.txt?rev=350565&r1=350564&r2=350565&view=diff
==============================================================================
--- libclc/trunk/CMakeLists.txt (original)
+++ libclc/trunk/CMakeLists.txt Mon Jan 7 12:20:37 2019
@@ -1,6 +1,7 @@
cmake_minimum_required( VERSION 3.9.2 )
project( libclc VERSION 0.2.0 LANGUAGES CXX )
+include( GNUInstallDirs )
# List of all targets
set( LIBCLC_TARGETS_ALL
@@ -145,8 +146,8 @@ endif()
# pkg-config file
configure_file( libclc.pc.in libclc.pc @ONLY )
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION share/pkgconfig )
-install( DIRECTORY generic/include/clc DESTINATION include )
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig )
+install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_use_default STATIC
@@ -154,7 +155,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_disable STATIC
generic/lib/subnormal_disable.ll )
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
- DESTINATION lib/clc )
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
endif()
find_program( PYTHON python )
@@ -274,7 +275,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
prepare_builtins )
add_custom_target( "prepare-${obj_suffix}" ALL
DEPENDS "${obj_suffix}" )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION lib/clc )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
# nvptx-- targets don't include workitem builtins
if( NOT ${t} MATCHES ".*ptx.*--$" )
add_test( NAME external-calls-${obj_suffix}
@@ -292,7 +293,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
create_symlink ${obj_suffix}
${alias_suffix}
DEPENDS "prepare-${obj_suffix}" )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION lib/clc )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
endforeach( a )
endforeach( d )
endforeach( t )
Modified: libclc/trunk/libclc.pc.in
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/libclc.pc.in?rev=350565&r1=350564&r2=350565&view=diff
==============================================================================
--- libclc/trunk/libclc.pc.in (original)
+++ libclc/trunk/libclc.pc.in Mon Jan 7 12:20:37 2019
@@ -1,5 +1,5 @@
-includedir=@CMAKE_INSTALL_PREFIX@/include
-libexecdir=@CMAKE_INSTALL_PREFIX@/lib/clc
+includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
+libexecdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/clc
Name: libclc
Description: Library requirements of the OpenCL C programming language
More information about the cfe-commits
mailing list