cmake_modules/FindGLEW.cmake
author Wuzzy <Wuzzy2@mail.ru>
Sat, 02 Nov 2019 13:01:28 +0100
changeset 15523 5a30396f8fb2
parent 11657 ae6706411b24
permissions -rw-r--r--
ClimbHome: Change misleading Seed assignment to nil value This was "Seed = ClimbHome", but ClimbHome was a nil value. This code still worked as the engine interpreted the nil value as empty string. But it can be very misleading. This changeset makes the Seed assignment more explicit by assigning the empty string directly. The compability has been tested.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
     1
# Find GLEW
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
     2
#
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
     3
# Once done this will define
10015
4feced261c68 partial merge of the webgl branch
koda
parents: 9244
diff changeset
     4
#  GLEW_FOUND - system has GLEW
4feced261c68 partial merge of the webgl branch
koda
parents: 9244
diff changeset
     5
#  GLEW_INCLUDE_DIR - the GLEW include directory
4feced261c68 partial merge of the webgl branch
koda
parents: 9244
diff changeset
     6
#  GLEW_LIBRARY - The library needed to use GLEW
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
     7
# Copyright (c) 2013, Vittorio Giovara <vittorio.giovara@gmail.com>
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
     8
#
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
     9
# Distributed under the OSI-approved BSD License (the "License");
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    10
# see accompanying file Copyright.txt for details.
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    11
#
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    12
# This software is distributed WITHOUT ANY WARRANTY; without even the
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    13
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    14
# See the License for more information.
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    15
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    16
include(FindPackageHandleStandardArgs)
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    17
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    18
find_path( GLEW_INCLUDE_DIR GL/glew.h
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    19
            /usr/include
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    20
            /usr/local/include
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    21
            /sw/include
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    22
            /opt/local/include
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    23
            $ENV{PROGRAMFILES}/GLEW/include
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    24
            DOC "The directory where GL/glew.h resides")
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    25
find_library( GLEW_LIBRARY
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    26
            NAMES GLEW glew glew32 glew32s
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    27
            PATHS
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    28
            /usr/lib64
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    29
            /usr/lib
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    30
            /usr/local/lib64
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    31
            /usr/local/lib
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    32
            /sw/lib
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    33
            /opt/local/lib
9201
bcf2f7798ebb redid FindGLEW in the right way (tm)
koda
parents: 8448
diff changeset
    34
            $ENV{PROGRAMFILES}/GLEW/lib
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    35
            DOC "The GLEW library")
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    36
11657
ae6706411b24 Hijack SDL2 and GLEW include and library when compiling to javascript
koda
parents: 10015
diff changeset
    37
if(BUILD_ENGINE_JS)
ae6706411b24 Hijack SDL2 and GLEW include and library when compiling to javascript
koda
parents: 10015
diff changeset
    38
    set(GLEW_INCLUDE_DIR "${EMSCRIPTEN_ROOT_PATH}/system/include")
ae6706411b24 Hijack SDL2 and GLEW include and library when compiling to javascript
koda
parents: 10015
diff changeset
    39
    SET(GLEW_LIBRARY "glew_emscripten_internal")
ae6706411b24 Hijack SDL2 and GLEW include and library when compiling to javascript
koda
parents: 10015
diff changeset
    40
endif()
ae6706411b24 Hijack SDL2 and GLEW include and library when compiling to javascript
koda
parents: 10015
diff changeset
    41
9244
bb95e351270c fix a few loose ends here
koda
parents: 9201
diff changeset
    42
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR)
bb95e351270c fix a few loose ends here
koda
parents: 9201
diff changeset
    43
mark_as_advanced(GLEW_LIBRARY GLEW_INCLUDE_DIR)
7997
7dff08baf9e3 add FindGLEW.cmake module
koda
parents:
diff changeset
    44