summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorPhilipp Möller <bootsarehax@gmail.com>2014-06-10 08:55:52 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-23 15:09:29 (GMT)
commit3d82a2234a6fb6dfc523264acb12b033e93b0830 (patch)
tree1cf30abf0d24a8482e89a8e7b8f89420c9545d93 /Modules
parent5a7ff42100dfec3e9b84f531153842198f59cd2e (diff)
downloadCMake-3d82a2234a6fb6dfc523264acb12b033e93b0830.zip
CMake-3d82a2234a6fb6dfc523264acb12b033e93b0830.tar.gz
CMake-3d82a2234a6fb6dfc523264acb12b033e93b0830.tar.bz2
FindGLEW: Add imported target and documentation
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindGLEW.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index 497a80c..f42182f 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -4,6 +4,15 @@
#
# Find the OpenGL Extension Wrangler Library (GLEW)
#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
+# if GLEW has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
# This module defines the following variables:
#
# ::
@@ -35,4 +44,11 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
+if(GLEW_FOUND AND NOT TARGET GLEW::GLEW)
+ add_library(GLEW::GLEW UNKNOWN IMPORTED)
+ set_target_properties(GLEW::GLEW PROPERTIES
+ IMPORTED_LOCATION "${GLEW_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
+endif()
+
mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)