summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorIvan Shapovalov <intelfx@intelfx.name>2016-07-24 19:10:39 +0300
committerIvan Shapovalov <intelfx@intelfx.name>2016-07-28 19:09:29 +0300
commit570cbcffa71e5142194921ae42a1541dc7c6e969 (patch)
tree75db4efec9b4d94e7a5fbd7e075ea505afa0a68b /CMakeLists.txt
parentffa35c623af4b0916f625f3a41000e75a1df7e1f (diff)
CMakeLists.txt: provide a find_package() config for dependent projects
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 16 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95d1d500..42a36732 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,11 +127,6 @@ endif()
# ==================================================================================================
-# Includes directories: CLBlast and OpenCL
-include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS})
-
-# ==================================================================================================
-
# Sets the supported routines and the used kernels. New routines and kernels should be added here.
set(KERNELS copy_fast copy_pad transpose_fast transpose_pad xaxpy xdot xger xgemm xgemv)
set(SAMPLE_PROGRAMS_CPP sgemm)
@@ -173,17 +168,27 @@ endforeach()
add_library(clblast SHARED ${SOURCES})
target_link_libraries(clblast ${OPENCL_LIBRARIES})
+# Includes directories: CLBlast and OpenCL
+target_include_directories(clblast PUBLIC
+ $<BUILD_INTERFACE:${clblast_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${clblast_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:include>
+ ${OPENCL_INCLUDE_DIRS})
+
# Sets the proper __declspec(dllexport) keyword for Visual Studio when the library is built
if(MSVC)
target_compile_definitions(clblast PRIVATE COMPILING_DLL=1) # requires at least CMake 2.8.11
endif()
# Installs the library
-install(TARGETS clblast DESTINATION lib)
+install(TARGETS clblast EXPORT CLBlast DESTINATION lib)
install(FILES include/clblast.h DESTINATION include)
install(FILES include/clblast_c.h DESTINATION include)
install(FILES include/clblast_half.h DESTINATION include)
+# Installs the config for find_package in dependent projects
+install(EXPORT CLBlast DESTINATION lib/cmake/CLBLast FILE CLBlastConfig.cmake)
+
# ==================================================================================================
# Sets a default platform ($DEVICEPLATFORM) and device ($DEFAULT_DEVICE) to run tuners and tests on
@@ -197,6 +202,11 @@ endif()
# ==================================================================================================
+# Includes directories: CLBlast and OpenCL
+include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS})
+
+# ==================================================================================================
+
# This section contains all the code related to the examples
if(SAMPLES)