summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-03 14:45:48 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-03 14:45:48 (GMT)
commite3f763765998b25707c364151a270e70d16e1744 (patch)
treecdfd56c567e8958cc520eb72b85b7bb7c61975a9 /Modules
parent4b7834467c21539bc478ccb3cd4b814057aa6cdd (diff)
parentb66d4739b5e0944a58d4a94431ed7ad042fad05d (diff)
downloadCMake-e3f763765998b25707c364151a270e70d16e1744.zip
CMake-e3f763765998b25707c364151a270e70d16e1744.tar.gz
CMake-e3f763765998b25707c364151a270e70d16e1744.tar.bz2
Merge topic 'FindOpenCL-imported-target'
b66d4739 FindOpenCL: Add an imported target
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindOpenCL.cmake20
1 files changed, 18 insertions, 2 deletions
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index 4d3ed84..feda315 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -4,7 +4,16 @@
#
# Try to find OpenCL
#
-# Once done this will define::
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``OpenCL::OpenCL``, if
+# OpenCL has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables::
#
# OpenCL_FOUND - True if OpenCL was found
# OpenCL_INCLUDE_DIRS - include directories for OpenCL
@@ -20,7 +29,7 @@
#
#=============================================================================
-# Copyright 2014 Matthaeus G. Chajdas
+# Copyright 2014-2016 Matthaeus G. Chajdas
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -134,3 +143,10 @@ find_package_handle_standard_args(
mark_as_advanced(
OpenCL_INCLUDE_DIR
OpenCL_LIBRARY)
+
+if(OpenCL_FOUND AND NOT TARGET OpenCL::OpenCL)
+ add_library(OpenCL::OpenCL UNKNOWN IMPORTED)
+ set_target_properties(OpenCL::OpenCL PROPERTIES
+ IMPORTED_LOCATION "${OpenCL_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${OpenCL_INCLUDE_DIRS}")
+endif()