Commit 194a0ae4 authored by Jan Möbius's avatar Jan Möbius

Trying a cmake version of glew

parent 57972fb6
......@@ -9,7 +9,6 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
)
# Linking for apple is special here as the linker pulls in the dependencies, we have to set them like in PluginLib!
......@@ -30,14 +29,8 @@ if( APPLE )
endforeach ()
link_directories (
${GLEW_LIBRARY_DIR}
${ADDITIONAL_PLUGINLIB_LINK_DIRS}
)
else (APPLE)
link_directories (
${GLEW_LIBRARY_DIR}
)
endif(APPLE)
if (WIN32)
......@@ -225,11 +218,12 @@ target_link_libraries (${OPENFLIPPER_PRODUCT_STRING}
OpenFlipperPluginLib
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
${COREAPP_ADDITIONAL_LINK_LIBRARIES}
${OPENFLIPPER_STATIC_PLUGINS}
libglew_shared
)
if (APPLE)
if ( EXISTS ${BRANDING_DIRECTORY} )
......
......@@ -42,13 +42,11 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${ADDITIONAL_PLUGINLIB_INCS}
${PACKAGE_INCLUDES}
)
link_directories (
${GLEW_LIBRARY_DIR}
${ADDITIONAL_PLUGINLIB_LINK_DIRS}
)
......@@ -142,7 +140,6 @@ target_link_libraries (OpenFlipperPluginLib
ACG
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
${FTGL_LIBS}
${ADDITIONAL_PLUGINLIB_LIBS}
)
......
......@@ -208,11 +208,6 @@ if (NOT OPENGL_FOUND)
message (FATAL_ERROR "OpengGL not found!")
endif ()
find_package (GLEW)
if (NOT GLEW_FOUND)
message (FATAL_ERROR "GLEW not found!")
endif ()
# using the internal openmesh delivered by the svn repo (default) or use some external installation
set (USE_INTERNAL_OPENMESH ON CACHE BOOL "Use and build internal version of OpenMesh found in libs_required")
......@@ -249,6 +244,7 @@ enable_testing()
# Build all additional libraries
# ========================================================================
add_subdirectory (OpenFlipper/libs_required/glew)
add_subdirectory (OpenFlipper/libs_required/OpenMesh)
add_subdirectory (OpenFlipper/libs_required/ACG)
......
# - Try to find GLEW
# Once done this will define
#
# GLEW_FOUND - system has GLEW
# GLEW_INCLUDE_DIR - the GLEW include directory
# GLEW_LIBRARY_DIR - where the libraries are
# GLEW_LIBRARY - Link these to use GLEW
#
IF (GLEW_INCLUDE_DIR)
# Already in cache, be silent
SET(GLEW_FIND_QUIETLY TRUE)
ENDIF (GLEW_INCLUDE_DIR)
if( WIN32 )
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:\libs" CACHE STRING "Default Library search dir on windows." )
endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
if( MSVC80 )
set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC" )
endif( MSVC80 )
if( MSVC71 )
set( COMPILER_PATH "C:/Program\ Files/Microsoft\ Visual\ Studio\ .NET\ 2003/Vc7" )
endif( MSVC71 )
FIND_PATH( GLEW_INCLUDE_DIR gl/glew.h gl/wglew.h
PATHS "${CMAKE_WINDOWS_LIBS_DIR}/glew/include"
"${CMAKE_WINDOWS_LIBS_DIR}/glew-1.6.0/include"
${COMPILER_PATH}/PlatformSDK/Include
"${VS_SEARCH_PATH}glew-2.0.0/include"
"${VS_SEARCH_PATH}glew-1.10.0/include"
"${VS_SEARCH_PATH}glew-1.13.0/include")
SET( GLEW_NAMES glew32 )
FIND_LIBRARY( GLEW_LIBRARY
NAMES ${GLEW_NAMES}
PATHS "${CMAKE_WINDOWS_LIBS_DIR}/glew/lib"
"${CMAKE_WINDOWS_LIBS_DIR}/glew-1.6.0/lib"
${COMPILER_PATH}/PlatformSDK/Lib
"${VS_SEARCH_PATH}glew-2.0.0/lib"
"${VS_SEARCH_PATH}glew-1.10.0/lib"
"${VS_SEARCH_PATH}glew-1.13.0/lib" )
else( WIN32 )
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h GL/wglew.h
PATHS /usr/local/include /usr/include )
SET( GLEW_NAMES glew GLEW )
FIND_LIBRARY( GLEW_LIBRARY
NAMES ${GLEW_NAMES}
PATHS /usr/lib /usr/local/lib )
endif( WIN32 )
GET_FILENAME_COMPONENT( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} PATH )
IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
SET(GLEW_FOUND TRUE)
ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
SET( GLEW_FOUND FALSE )
SET( GLEW_LIBRARY_DIR )
ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
......@@ -527,7 +527,6 @@ function (_build_openflipper_plugin plugin)
${${_PLUGIN}_DEPS_INCDIRS}
${${_PLUGIN}_INCDIRS}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/OpenFlipper/PluginLib
${PACKAGE_INCLUDES}
${${_PLUGIN}_TYPE_INCLUDES}
......
......@@ -22,11 +22,6 @@ if (NOT OPENGL_FOUND)
message (FATAL_ERROR "OpengGL not found!")
endif ()
find_package (GLEW)
if (NOT GLEW_FOUND)
message (FATAL_ERROR "GLEW not found!")
endif ()
find_package (OpenMesh)
if (NOT OPENMESH_FOUND)
message (FATAL_ERROR "OpenMesh not found!")
......@@ -36,8 +31,7 @@ set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR} )
${OPENGL_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES "" )
set(ADDITIONAL_BUILD_DIRS "" )
......@@ -65,10 +59,6 @@ include_directories (
${INCLUDE_DIRS}
)
link_directories (
${GLEW_LIBRARY_DIR}
)
#===================================================================
# ACG Library setup
#===================================================================
......@@ -135,9 +125,10 @@ endif()
target_link_libraries ( ACG ${OPENMESH_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARY}
${ADDITIONAL_LINK_LIBRARIES} )
add_dependencies(ACG libglew_shared)
#===================================================================
# Setting up the unit tests
#===================================================================
......
language: cpp
sudo: false
install:
script:
- make -C auto clobber
- make extensions
- make dist-src
- make clean && SYSTEM=linux make
- make clean && SYSTEM=linux-osmesa make
#- make clean && SYSTEM=linux-egl make
- make clean && SYSTEM=linux-clang make
#- make clean && SYSTEM=linux-clang-egl make
- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' . && make && popd
- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' -DGLEW_OSMESA=1 . && make && popd
#- pushd build/cmake && git clean -xdf . && cmake -G 'Unix Makefiles' -DGLEW_EGL=1 . && make && popd
addons:
apt:
packages:
- git
- cmake
- dos2unix
- libosmesa6-dev
# - libegl1-mesa-dev
artifacts:
paths:
- $(ls *.zip *.tgz | tr "\n" ":")
- $(find doc -type f | tr "\n" ":")
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
PROJECT( "glew" )
SET( SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src )
SET( INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include )
SET( RC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build )
#SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
#SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
#SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
OPTION( glew-cmake_BUILD_SHARED "Build the shared glew library" ON )
OPTION( glew-cmake_BUILD_STATIC "Build the static glew library" ON )
OPTION( glew-cmake_BUILD_SINGLE_CONTEXT "Build the single context glew library" ON )
OPTION( glew-cmake_BUILD_MULTI_CONTEXT "Build the multi context glew library" ON )
SET( LIBGLEW_SRCS ${SRC_DIR}/glew.c )
IF( WIN32 )
ADD_DEFINITIONS( -DWIN32_MEAN_AND_LEAN -DVC_EXTRALEAN -DGLEW_BUILD -D_CRT_SECURE_NO_WARNINGS )
ENDIF( )
IF( MSVC )
LIST( APPEND LIBGLEW_SRCS ${RC_DIR}/glew.rc )
ENDIF( )
IF( NOT USE_GLU )
ADD_DEFINITIONS( -DGLEW_NO_GLU )
ENDIF( )
IF( WIN32 )
SET( GL_LIBRARY opengl32 )
ELSEIF( APPLE )
FIND_LIBRARY( GL_LIBRARY OpenGL )
FIND_LIBRARY( AGL_LIBRARY AGL )
SET( PLATFORM_SPECIFIC_LIBRARIES ${AGL_LIBRARY} )
ELSE( )
SET( GL_LIBRARY GL )
SET( PLATFORM_SPECIFIC_LIBRARIES X11 dl Xext )
ENDIF( )
IF ( glew-cmake_BUILD_STATIC )
IF ( glew-cmake_BUILD_SINGLE_CONTEXT )
ACG_ADD_LIBRARY( libglew_static STATIC ${LIBGLEW_SRCS} )
SET_TARGET_PROPERTIES( libglew_static PROPERTIES
ARCHIVE_OUTPUT_NAME "glew"
DEBUG_POSTFIX d )
TARGET_INCLUDE_DIRECTORIES( libglew_static PUBLIC ${INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( libglew_static ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} )
INSTALL( TARGETS libglew_static DESTINATION lib )
ENDIF ( )
IF ( glew-cmake_BUILD_MULTI_CONTEXT )
ACG_ADD_LIBRARY( libglewmx_static STATIC ${LIBGLEW_SRCS} )
SET_TARGET_PROPERTIES( libglewmx_static PROPERTIES
ARCHIVE_OUTPUT_NAME "glewmx"
DEBUG_POSTFIX d )
TARGET_COMPILE_DEFINITIONS( libglewmx_static INTERFACE GLEW_MX)
TARGET_INCLUDE_DIRECTORIES( libglewmx_static PUBLIC ${INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( libglewmx_static ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} )
INSTALL( TARGETS libglewmx_static DESTINATION lib )
ENDIF ( )
ENDIF ( )
IF ( glew-cmake_BUILD_SHARED )
IF ( glew-cmake_BUILD_SINGLE_CONTEXT )
ACG_ADD_LIBRARY( libglew_shared SHARED ${LIBGLEW_SRCS} )
SET_TARGET_PROPERTIES( libglew_shared PROPERTIES
RUNTIME_OUTPUT_NAME "glew"
LIBRARY_OUTPUT_NAME "glew"
DEBUG_POSTFIX d )
TARGET_INCLUDE_DIRECTORIES( libglew_shared PUBLIC ${INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( libglew_shared ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} )
INSTALL( TARGETS libglew_shared DESTINATION lib )
ENDIF ( )
IF ( glew-cmake_BUILD_MULTI_CONTEXT )
ACG_ADD_LIBRARY( libglewmx_shared SHARED ${LIBGLEW_SRCS} )
SET_TARGET_PROPERTIES( libglewmx_shared PROPERTIES
RUNTIME_OUTPUT_NAME "glewmx"
LIBRARY_OUTPUT_NAME "glewmx"
DEBUG_POSTFIX d )
TARGET_COMPILE_DEFINITIONS( libglewmx_shared INTERFACE GLEW_MX)
TARGET_INCLUDE_DIRECTORIES( libglewmx_shared PUBLIC ${INCLUDE_DIR} )
TARGET_LINK_LIBRARIES( libglewmx_shared ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} )
INSTALL( TARGETS libglewmx_shared DESTINATION lib )
ENDIF ( )
ENDIF ( )
FILE( GLOB PUBLIC_HEADERS "include/GL/*.h" )
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION include/GL/ )
IF( ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR} AND NOT ONLY_LIBS )
SET( GLEWINFO_SRCS ${SRC_DIR}/glewinfo.c )
SET( VISUALINFO_SRCS ${SRC_DIR}/visualinfo.c )
IF( MSVS )
LIST( APPEND GLEWINFO_SRCS ${RC_DIR}/glewinfo.rc )
LIST( APPEND VISUALINFO_SRCS ${RC_DIR}/visualinfo.rc )
ENDIF( )
ADD_EXECUTABLE( glewinfo ${GLEWINFO_SRCS} )
ADD_EXECUTABLE( visualinfo ${VISUALINFO_SRCS} )
IF ( glew-cmake_BUILD_STATIC )
TARGET_LINK_LIBRARIES( glewinfo libglew_static )
TARGET_LINK_LIBRARIES( visualinfo libglew_static )
ELSE ( )
TARGET_LINK_LIBRARIES( glewinfo libglew_shared )
TARGET_LINK_LIBRARIES( visualinfo libglew_shared )
ENDIF ( )
INSTALL( TARGETS glewinfo visualinfo DESTINATION bin )
ENDIF( )
The OpenGL Extension Wrangler Library
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
Mesa 3-D graphics library
Version: 7.0
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2007 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
#!gmake
## The OpenGL Extension Wrangler Library
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002, Lev Povalahev
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
## * Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright notice,
## this list of conditions and the following disclaimer in the documentation
## and/or other materials provided with the distribution.
## * The name of the author may be used to endorse or promote products
## derived from this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
## THE POSSIBILITY OF SUCH DAMAGE.
include config/version
SHELL = /bin/sh
SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
ifeq ($(SYSTEM.SUPPORTED), 1)
include config/Makefile.$(SYSTEM)
else
$(error "Platform '$(SYSTEM)' not supported")
endif
GLEW_PREFIX ?= /usr
GLEW_DEST ?= /usr
BINDIR ?= $(GLEW_DEST)/bin
LIBDIR ?= $(GLEW_DEST)/lib
INCDIR ?= $(GLEW_DEST)/include/GL
PKGDIR ?= $(GLEW_DEST)/lib/pkgconfig
ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU)
LIBGLU = glu
endif
DIST_NAME ?= glew-$(GLEW_VERSION)
DIST_SRC_ZIP ?= $(shell pwd)/$(DIST_NAME).zip
DIST_SRC_TGZ ?= $(shell pwd)/$(DIST_NAME).tgz
DIST_WIN32 ?= $(shell pwd)/$(DIST_NAME)-win32.zip
DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME)
# To disable stripping of linked binaries either:
# - use STRIP= on gmake command-line
# - edit this makefile to set STRIP to the empty string
# (Note: STRIP does not affect the strip in the install step)
#
# To disable symlinks:
# - use LN= on gmake command-line
AR ?= ar
ARFLAGS ?= cr
INSTALL ?= install
STRIP ?= strip
RM ?= rm -f
LN ?= ln -sf
UNIX2DOS ?= unix2dos -q
DOS2UNIX ?= dos2unix -q
ifneq (,$(filter debug,$(MAKECMDGOALS)))
OPT = -g
else
OPT = $(POPT)
endif
INCLUDE = -Iinclude
CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
all debug: glew.lib glew.bin
# GLEW shared and static libraries
LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
LIB.LIBS := $(GL_LDFLAGS)
LIB.SRCS := src/glew.c
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
LIB.OBJS := $(addprefix tmp/$(SYSTEM)/default/static/,$(LIB.SRCS.NAMES))
LIB.OBJS := $(LIB.OBJS:.c=.o)
LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/default/shared/,$(LIB.SRCS.NAMES))
LIB.SOBJS := $(LIB.SOBJS:.c=.o)
glew.lib: glew.lib.shared glew.lib.static
glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc
glew.lib.static: lib lib/$(LIB.STATIC) glew.pc
.PHONY: glew.lib glew.lib.shared glew.lib.static
lib:
mkdir lib
lib/$(LIB.STATIC): $(LIB.OBJS)
ifneq ($(AR),)
$(AR) $(ARFLAGS) $@ $^