2017-10-25 14:57:25 +00:00
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_GLEW libglew)
|
|
|
|
endif()
|
2017-09-12 18:03:06 +00:00
|
|
|
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_lib(GLEW glew)
|
2017-09-12 18:03:06 +00:00
|
|
|
find_library(GLEW_LIBRARY
|
|
|
|
NAMES GLEW glew32
|
|
|
|
HINTS ${HINTS_GLEW_LIBDIR} ${PC_GLEW_LIBDIR} ${PC_GLEW_LIBRARY_DIRS}
|
|
|
|
PATHS ${PATHS_GLEW_LIBDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-09-12 18:03:06 +00:00
|
|
|
)
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_include(GLEW glew "${GLEW_LIBRARY}")
|
|
|
|
find_path(GLEW_INCLUDEDIR GL
|
|
|
|
HINTS ${HINTS_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDE_DIRS}
|
|
|
|
PATHS ${PATHS_GLEW_INCLUDEDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-10-24 10:10:46 +00:00
|
|
|
)
|
2017-09-12 18:03:06 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDEDIR)
|
|
|
|
|
|
|
|
mark_as_advanced(GLEW_LIBRARY GLEW_INCLUDEDIR)
|
|
|
|
|
|
|
|
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
|
|
|
|
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDEDIR})
|
|
|
|
|
2017-10-24 13:29:53 +00:00
|
|
|
is_bundled(IS_BUNDLED "${GLEW_LIBRARY}")
|
|
|
|
if(IS_BUNDLED AND TARGET_OS STREQUAL "windows")
|
2017-09-12 18:03:06 +00:00
|
|
|
set(GLEW_COPY_FILES "${EXTRA_GLEW_LIBDIR}/glew32.dll")
|
|
|
|
else()
|
|
|
|
set(GLEW_COPY_FILES)
|
|
|
|
endif()
|