Skip to content

Commit 17b22e8

Browse files
author
Timmy
committed
Merge pull request #96 from TimmyLiu/develop
fix cmake bug introduced by pull request #75
2 parents f8af95c + 2f845e2 commit 17b22e8

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/samples/CMakeLists.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ target_link_libraries(example_sasum ${OPENCL_LIBRARIES} clBLAS)
261261
set_property( TARGET example_sasum PROPERTY FOLDER "Samples")
262262

263263
# CPack configuration; include the executable into the package
264+
if( WIN32 )
265+
set( CLBLAS_EXAMPLE_INSTALL_DESTINATION bin${SUFFIX_BIN})
266+
else( )
267+
set( CLBLAS_EXAMPLE_INSTALL_DESTINATION share/clBLAS/samples)
268+
endif()
264269
install( TARGETS example_sgemm example_sgemv example_ssymv example_ssyrk
265270
example_ssyr2k example_strmm example_strsm
266271
example_strmv example_strsv example_sger example_cher example_ssyr
@@ -274,18 +279,20 @@ install( TARGETS example_sgemm example_sgemv example_ssymv example_ssyrk
274279
example_snrm2 example_sasum example_isamax
275280

276281
version
277-
if( WIN32 )
278-
RUNTIME DESTINATION bin${SUFFIX_BIN}
279-
else ( )
280-
RUNTIME DESTINATION share/clBLAS/samples
281-
endif( )
282-
LIBRARY DESTINATION lib${SUFFIX_LIB}
283-
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
282+
RUNTIME DESTINATION ${CLBLAS_EXAMPLE_INSTALL_DESTINATION}
283+
LIBRARY DESTINATION lib${SUFFIX_LIB}
284+
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
284285
)
285286

286287
configure_file( "${PROJECT_SOURCE_DIR}/samples/CMakeLists.pack"
287288
"${PROJECT_BINARY_DIR}/samples/CMakeLists.txt" COPYONLY )
288289

290+
if( WIN32 )
291+
set( CLBLAS_SAMPLE_INSTALL_DESTINATION samples)
292+
else( )
293+
set( CLBLAS_SAMPLE_INSTALL_DESTINATION share/clBLAS/samples/src)
294+
endif()
295+
289296
install(FILES
290297
example_sgemv.c
291298
example_ssymv.c
@@ -336,9 +343,5 @@ install(FILES
336343
clBlasVersion.c
337344
${PROJECT_BINARY_DIR}/samples/CMakeLists.txt
338345

339-
if( WIN32 )
340-
DESTINATION samples
341-
else ( )
342-
DESTINATION share/clBLAS/samples/src
343-
endif()
346+
DESTINATION ${CLBLAS_SAMPLE_INSTALL_DESTINATION}
344347
)

0 commit comments

Comments
 (0)