mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 12:28:51 +02:00
cleanup GLEW find module
This commit is contained in:
parent
cb384ac01b
commit
c8902fe554
1 changed files with 13 additions and 23 deletions
|
@ -18,27 +18,17 @@
|
|||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
|
||||
if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARY)
|
||||
set(GLEW_FOUND TRUE)
|
||||
else ()
|
||||
if (WIN32)
|
||||
set(WIN_GLEW_SEARCH_DIRS "${GLEW_ROOT_DIR}" "$ENV{GLEW_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/glew")
|
||||
|
||||
find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
|
||||
find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY)
|
||||
if (WIN32)
|
||||
set(WIN_GLEW_SEARCH_DIRS "${GLEW_ROOT_DIR}" "$ENV{GLEW_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/glew")
|
||||
|
||||
find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
|
||||
if (GLEW_FOUND)
|
||||
if (NOT GLEW_FIND_QUIETLY)
|
||||
message(STATUS "Found GLEW: ${GLEW_LIBRARY}")
|
||||
endif ()
|
||||
else ()
|
||||
if (GLEW_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find GLEW")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
find_library(GLEW_LIBRARY_RELEASE glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
find_library(GLEW_LIBRARY_DEBUG glew32s PATH_SUFFIXES "lib/Debug/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(GLEW)
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY)
|
Loading…
Reference in a new issue