summaryrefslogtreecommitdiff
path: root/Modules/FindGLEW.cmake
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2022-12-27 17:20:24 +0900
committerJinWang An <jinwang.an@samsung.com>2022-12-27 17:20:24 +0900
commit58664688bb50990e7aa416a6d1ac4939fa589198 (patch)
treed37c80132bb51650ff7c70688c4ac572af42af30 /Modules/FindGLEW.cmake
parentdf9806c0f5714ed294007ad149c001a983d1a73f (diff)
downloadcmake-58664688bb50990e7aa416a6d1ac4939fa589198.tar.gz
cmake-58664688bb50990e7aa416a6d1ac4939fa589198.tar.bz2
cmake-58664688bb50990e7aa416a6d1ac4939fa589198.zip
Imported Upstream version 3.25.0upstream/3.25.0
Diffstat (limited to 'Modules/FindGLEW.cmake')
-rw-r--r--Modules/FindGLEW.cmake27
1 files changed, 25 insertions, 2 deletions
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index b9ebe08bd..bfde40b3d 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -63,11 +63,36 @@ This module defines the following variables:
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
find_package(GLEW CONFIG QUIET)
if(GLEW_FOUND)
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_CONFIG)
+ get_target_property(GLEW_INCLUDE_DIRS GLEW::GLEW INTERFACE_INCLUDE_DIRECTORIES)
+ set(GLEW_INCLUDE_DIR ${GLEW_INCLUDE_DIRS})
+ get_target_property(_GLEW_DEFS GLEW::GLEW INTERFACE_COMPILE_DEFINITIONS)
+ if("${_GLEW_DEFS}" MATCHES "GLEW_STATIC")
+ get_target_property(GLEW_LIBRARY_DEBUG GLEW::GLEW IMPORTED_LOCATION_DEBUG)
+ get_target_property(GLEW_LIBRARY_RELEASE GLEW::GLEW IMPORTED_LOCATION_RELEASE)
+ else()
+ get_target_property(GLEW_LIBRARY_DEBUG GLEW::GLEW IMPORTED_IMPLIB_DEBUG)
+ get_target_property(GLEW_LIBRARY_RELEASE GLEW::GLEW IMPORTED_IMPLIB_RELEASE)
+ endif()
+ get_target_property(_GLEW_LINK_INTERFACE GLEW::GLEW IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) # same for debug and release
+ list(APPEND GLEW_LIBRARIES ${_GLEW_LINK_INTERFACE})
+ list(APPEND GLEW_LIBRARY ${_GLEW_LINK_INTERFACE})
+ select_library_configurations(GLEW)
+ if("${_GLEW_DEFS}" MATCHES "GLEW_STATIC")
+ set(GLEW_STATIC_LIBRARIES ${GLEW_LIBRARIES})
+ else()
+ set(GLEW_SHARED_LIBRARIES ${GLEW_LIBRARIES})
+ endif()
+ unset(_GLEW_DEFS)
+ unset(_GLEW_LINK_INTERFACE)
+ unset(GLEW_LIBRARY)
+ unset(GLEW_LIBRARY_DEBUG)
+ unset(GLEW_LIBRARY_RELEASE)
return()
endif()
@@ -171,8 +196,6 @@ find_library(GLEW_STATIC_LIBRARY_DEBUG
set(CMAKE_FIND_LIBRARY_SUFFIXES ${__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES})
unset(__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES)
-include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
-
select_library_configurations(GLEW_SHARED)
select_library_configurations(GLEW_STATIC)