Hello Carlo,

Am Donnerstag, 12. Juli 2012, 09:18:10 schrieb Carlo Nicolini:
> Hi you all, I'm trying to find an updated, simple to use and effective
> FindGlew.cmake module, because I've to include and link Glew (
> http://glew.sourceforge.net/index.html ) in my project, which needs to be
> compiled on win32, linux and osx.
> 
> Can somebody help me?

I have a find module attached. It was written by me some time ago by using some 
information from the CMake wiki. I do not know if it complies with any CMake 
standards, but it works for me. It is used on GNU/Linux, Windows and OS X in 
our project.

Kind regards
Benjamin
# Try to find GLEW. Once done, this will define:
#
#   GLEW_FOUND - variable which returns the result of the search
#   GLEW_INCLUDE_DIRS - list of include directories
#   GLEW_LIBRARIES - options for the linker

find_package(PkgConfig)
pkg_check_modules(PC_GLEW QUIET glew)

find_path(GLEW_INCLUDE_DIR
	GL/glew.h
	HINTS ${PC_GLEW_INCLUDEDIR} ${PC_GLEW_INCLUDE_DIRS}
)
find_library(GLEW_LIBRARY
	GLEW
	HINTS ${PC_GLEW_LIBDIR} ${PC_GLEW_LIBRARY_DIRS}
)

set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
set(GLEW_LIBRARIES ${GLEW_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLEW DEFAULT_MSG
	GLEW_INCLUDE_DIR
	GLEW_LIBRARY
)

mark_as_advanced(
	GLEW_INCLUDE_DIR
	GLEW_LIBRARY
)
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to