Results 1 to 1 of 1

Thread: Finding OpenGL dev files using Cmake module

  1. #1
    Join Date
    Jul 2009
    Location
    Oregon
    Beans
    321

    Finding OpenGL dev files using Cmake module

    I'm trying to find some opengl dev files and I had it working great in 11.10. I can just barely move around cmake and kind of wrap my head around linux development.

    If anyone can provide a better explanation of how I can solve this problem after upgrades and what I should look for in the future would be a huge help.

    Here is one of my cmake modules.

    Code:
    INCLUDE (FindPackageHandleStandardArgs)
    FIND_PACKAGE(PkgConfig ${gl_FIND_REQUIRED} ${gl_FIND_QUIETLY})
    IF (PKG_CONFIG_FOUND)
        SET(PKG_CONFIG_PATH_ENV_VAR $ENV{PKG_CONFIG_PATH})
        IF (NOT PKG_CONFIG_PATH_ENV_VAR)
            IF (gl_FIND_REQUIRED)
                MESSAGE (FATAL_ERROR "Environment variable PKG_CONFIG_PATH not set. Setting this variable is required in order for pkg-config to locate installed software packages.")
            ENDIF (gl_FIND_REQUIRED)
        ENDIF (NOT PKG_CONFIG_PATH_ENV_VAR)
        PKG_CHECK_MODULES (gl gl)
        IF (gl_FOUND)
            SET(gl_LIBRARY ${gl_LIBRARIES})
            SET(gl_INCLUDE_DIR ${gl_INCLUDEDIR})
            SET(gl_LIBRARY_DIR ${gl_LIBRARY_DIRS})
            IF (NOT gl_FIND_QUIETLY)
                MESSAGE(STATUS "    includedir: ${gl_INCLUDE_DIR}")
                MESSAGE(STATUS "    librarydir: ${gl_LIBRARY_DIR}")
            ENDIF (NOT gl_FIND_QUIETLY)
        ENDIF(gl_FOUND)
    ENDIF (PKG_CONFIG_FOUND)
    FIND_PACKAGE_HANDLE_STANDARD_ARGS(gl DEFAULT_MSG gl_LIBRARY gl_INCLUDE_DIR)
    I have basically the same file for glu and glui.

    I am not sure what got screwed up in my dev enviornment, but your help is much appreciated.

    The error
    Code:
     DrawGLScene(): error: undefined reference to 'glutSwapBuffers'
    Last edited by Cardale; May 28th, 2012 at 10:22 PM.
    Asus G73JW ROG-A3B7M
    Intel Core i7 || 16GB RAM || 802.11n+BT || 2 x 500GB Hybrid Drives || Nvidia GTX 460M

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •