update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
--- a/cmake_modules/FindGLEW.cmake Tue Feb 19 22:45:02 2013 +0400
+++ b/cmake_modules/FindGLEW.cmake Wed Feb 20 02:21:14 2013 +0100
@@ -3,17 +3,17 @@
# Once done this will define
#
# GLEW_FOUND
-# GLEW_INCLUDE_PATH
+# GLEW_INCLUDE_DIRS
# GLEW_LIBRARY
#
-if (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+if (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
# in cache already
set(GLEW_FOUND TRUE)
-else (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+else (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
IF (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+ FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
DOC "The directory where GL/glew.h resides")
@@ -25,7 +25,7 @@
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+ FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h
/usr/include
/usr/local/include
/sw/include
@@ -43,17 +43,17 @@
DOC "The GLEW library")
ENDIF (WIN32)
- IF (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+ IF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
- ELSE (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+ ELSE (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
- ENDIF (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+ ENDIF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
-endif(GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
+endif(GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
if (GLEW_FOUND)
if (NOT GLEW_FIND_QUIETLY)
- message(STATUS "Found GLEW: ${GLEW_LIBRARY}, ${GLEW_INCLUDE_PATH}")
+ message(STATUS "Found GLEW: ${GLEW_LIBRARY}, ${GLEW_INCLUDE_DIRS}")
endif (NOT GLEW_FIND_QUIETLY)
else (GLEW_FOUND)
if (GLEW_FIND_REQUIRED)
@@ -61,4 +61,5 @@
endif (GLEW_FIND_REQUIRED)
endif (GLEW_FOUND)
-#MARK_AS_ADVANCED( GLEW_FOUND )
\ No newline at end of file
+#MARK_AS_ADVANCED( GLEW_FOUND )
+
--- a/project_files/hwc/CMakeLists.txt Tue Feb 19 22:45:02 2013 +0400
+++ b/project_files/hwc/CMakeLists.txt Wed Feb 20 02:21:14 2013 +0100
@@ -8,9 +8,9 @@
find_package(SDL_ttf REQUIRED)
#compile our rtl implementation
+include_directories(${GLEW_INCLUDE_DIRS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
add_subdirectory(rtl)
-include_directories("${GLEW_INCLUDE_PATH}")
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl")
configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)