1
1
cmake_minimum_required ( VERSION 3.9.2 )
2
2
3
3
project ( libclc VERSION 0.2.0 LANGUAGES CXX )
4
+ include ( GNUInstallDirs )
4
5
5
6
# List of all targets
6
7
set ( LIBCLC_TARGETS_ALL
@@ -145,16 +146,16 @@ endif()
145
146
146
147
# pkg-config file
147
148
configure_file ( libclc.pc.in libclc.pc @ONLY )
148
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /libclc.pc DESTINATION share /pkgconfig )
149
- install ( DIRECTORY generic/include /clc DESTINATION include )
149
+ install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /libclc.pc DESTINATION ${CMAKE_INSTALL_DATADIR} /pkgconfig )
150
+ install ( DIRECTORY generic/include /clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
150
151
151
152
if ( ENABLE_RUNTIME_SUBNORMAL )
152
153
add_library ( subnormal_use_default STATIC
153
154
generic/lib/subnormal_use_default.ll )
154
155
add_library ( subnormal_disable STATIC
155
156
generic/lib/subnormal_disable.ll )
156
157
install ( TARGETS subnormal_use_default subnormal_disable ARCHIVE
157
- DESTINATION lib /clc )
158
+ DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
158
159
endif ()
159
160
160
161
find_program ( PYTHON python )
@@ -274,7 +275,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
274
275
prepare_builtins )
275
276
add_custom_target ( "prepare-${obj_suffix} " ALL
276
277
DEPENDS "${obj_suffix} " )
277
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${obj_suffix} DESTINATION lib /clc )
278
+ install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
278
279
# nvptx-- targets don't include workitem builtins
279
280
if ( NOT ${t} MATCHES ".*ptx.*--$" )
280
281
add_test ( NAME external-calls-${obj_suffix}
@@ -292,7 +293,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
292
293
create_symlink ${obj_suffix}
293
294
${alias_suffix}
294
295
DEPENDS "prepare-${obj_suffix} " )
295
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION lib /clc )
296
+ install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
296
297
endforeach ( a )
297
298
endforeach ( d )
298
299
endforeach ( t )
0 commit comments