summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenGL.cmake
Commit message (Collapse)AuthorAgeFilesLines
* cmake_policy: Add undocumented GET_WARNING commandKyle Edwards2018-10-101-4/+2
| | | | | | | This command is intended for modules that issue policy warnings so they can get the warning string from CMake in a uniform manner, rather than duplicating the string. Several modules been updated to include an example of the usage of this new command.
* Help: Convert FindOpenGL documentation to block commentKyle Edwards2018-10-101-119/+120
|
* FindOpenGL: remove duplicate OpenGL::GL referenceBen Boeckel2018-01-181-1/+0
|
* Merge topic 'hardcoded-path-removal'Brad King2017-11-271-9/+7
|\ | | | | | | | | | | | | | | | | | | | | a62d50ec Modules: Replace coded PATHS with PATH_SUFFIXES fd56d6a8 FindMPEG,2: Update to current libmpeg2 behavior 5f382cd8 FindPike: Update names and paths 6720807d FindAVIFile: Replace PATHS with updated suffixes f88ef9a9 Modules: Remove paths set as global Unix prefixes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1502
| * Modules: Remove paths set as global Unix prefixesChristian Pfeiffer2017-11-201-9/+7
| | | | | | | | | | This commit removes hardcoded paths that are already given in the platform files or in `UnixPath` on a global level.
* | FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GLBrad King2017-11-171-4/+33
|/ | | | Fixes: #17449
* FindOpenGL: Add option to prefer GLVND for legacy GLBrad King2017-11-151-13/+56
| | | | | | | | | | | | | | | | | Since commit v3.10.0-rc5~3^2 (FindOpenGL: Default to non-GLVND libraries for legacy GL, 2017-11-08) users may set `OPENGL_gl_LIBRARY` to empty to use GLVND components for the legacy GL interfaces. This is useful only when one knows in advance that the GLVND components will be found. Add a `OpenGL_GL_PREFERENCE` variable to specify a preference for legacy GL or GLVND. The latter can suppress `OPENGL_gl_LIBRARY` only when the needed GLVND components are found. If no preference is explicitly specified, choose a default based on whether GLVND components were requested (because this indicates the project has been updated for CMake 3.10). Issue: #17437 Issue: #17449
* FindOpenGL: Re-order component library searchesBrad King2017-11-151-7/+8
| | | | | Move the search for the legacy GL library to after the GLVND libraries. For now we still always look for both.
* FindOpenGL: Default to non-GLVND libraries for legacy GLBrad King2017-11-091-20/+24
| | | | | | | | | | | | | | | Projects using `OPENGL_LIBRARIES` or `OpenGL::GL` expect legacy GL. Although GLVND OpenGL+GLX provides legacy GL interfaces, using those library files may conflict with legacy GL library files used by dependencies (or dependents) of such projects. Therefore we should not yet use OpenGL+GLX when a legacy GL library is available. If `OPENGL_gl_LIBRARY` is set then use it as the legacy GL library. If it is *not* set then fall back to using GLVND OpenGL+GLX to provide legacy GL interfaces. This will allow users to build projects using GLVND even if they have not been ported. Fixes: #17437
* FindOpenGL: Clarify logic constructing OPENGL_LIBRARIESBrad King2017-11-071-1/+2
| | | | | | | Our comment says the logic matches that for OpenGL::GL. Structure the logic the same way to make this clearer. Issue: #17437
* FindOpenGL: Add support for GLVND on LinuxTom Fogal2017-09-251-39/+280
| | | | | | | | | | | | Find GLVND components if available. Add `GLX` and `EGL` options for COMPONENTS that allow requesting these libraries explicitly. Introduce new import targets for these windowing-system-specific libraries. On a GLVND system, populate the legacy `OPENGL_LIBRARIES` variable and the `OpenGL::GL` target using the `OpenGL` and `GLX` components. On non-GLVND systems, continue to use the legacy `GL` library and simply do not provide the GLVND components. Application code can choose to adapt based on the availability of GLVND components as imported targets.
* Use string(APPEND) in ModulesDaniel Pfeifer2017-05-171-2/+2
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* FindOpenGL: Provide imported targets for GL and GLUBrad King2016-12-021-0/+59
| | | | | | | | | | | | | | | | Create OpenGL::GL and OpenGL::GLU imported targets using the locations found. This feature was originally added by commit v3.1.0-rc1~420^2~2 (FindOpenGL: Provide imported targets for GL and GLU, 2014-05-31) but had to be reverted by commit v3.1.0-rc3~10^2 (FindOpenGL: Revert support for imported targets, 2014-12-01) due to issue #15267. Since then we added support for `IMPORTED_LIBNAME` to interface libraries, so use it to handle the case where we have only the library name without an absolute path. Inspired-by: Philipp Möller <bootsarehax@googlemail.com> Closes: #15267
* Find*.cmake: drop the comments before including FPHSARolf Eike Beer2016-11-281-2/+0
| | | | | No need to explain this over and over again. While at it, do some other minor cleanups to whitespace and comments (i.e. delete them).
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* FindOpenGL: Don't add AGL to OPENGL_LIBRARIES on OS X.David Gobbi2015-12-141-4/+8
| | | | | | | | | | CMake had been setting OPENGL_glu_LIBRARY to AGL.framework, even though AGL is not GLU. AGL is simply the GL component for the deprecated Carbon framework. GLU is provided by OpenGL.framework. A side effect of the old behavior was that if AGL was not found (it is absent from OS X SDK 10.10 or later), then OPENGL_GLU_FOUND would be incorrectly set to "NO".
* Merge topic 'FindOpenGL-revert-imported-targets'Brad King2014-12-031-40/+0
|\ | | | | | | | | 02e34de2 FindOpenGL: Revert support for imported targets (#15267)
| * FindOpenGL: Revert support for imported targets (#15267)Brad King2014-12-011-40/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert the feature added by commit v3.1.0-rc1~420^2~2 (FindOpenGL: Provide imported targets for GL and GLU, 2014-05-31). Unfortunately it does not work on Windows because the full path to each library file is not actually known. The IMPORTED_LOCATION of an imported target must be a full path, but OPENGL_gl_LIBRARY is just 'opengl32' on Windows because the actual library file is in some implicit link directory that we may know know. More infrastructure will be needed in CMake to allow a name-only imported library. Until that exists, we will not be able to provide imported targets in FindOpenGL.
* | FindOpenGL: Drop explicit dependency on X11 (#15268)Brad King2014-12-011-13/+0
|/ | | | | | | | | | | | | | | | In commit 079e8469ab (... OpenGL always needs X11 on Unix, 2002-09-05) the FindOpenGL module was taught to search for X11 as a dependency of the OpenGL library. This was done without a detailed explanation, and the dependency should not be explicitly needed because OpenGL headers should not expose applications to X11 APIs directly. Unfortunately the only way to know if anything legitimately depends on this behavior (perhaps in static library cases) is to simply remove it and wait for issues to be reported. If so, then we can add some kind of compatibility setting for this later. Add a release note to draw attention to this change. Reported-by: Dainius "GreatEmerald" Masiliūnas <pastas4@gmail.com>
* FindOpenGL: Fix typo in documented target nameBrad King2014-06-091-1/+1
| | | | | | We provide "OpenGL::GL", not "OpenGL::OpenGL". Reported-by: Daniel Pfeifer
* FindOpenGL: Provide imported targets for GL and GLUPhilipp Möller2014-06-051-0/+40
| | | | | Create OpenGL::GL and OpenGL::GLU imported targets using the locations found.
* FindOpenGL: Organize and format module documentationPhilipp Möller2014-06-051-18/+24
|
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-11/+25
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* FindOpenGL: require headers to be found on non-Windows platforms (#13746)Rolf Eike Beer2013-04-171-1/+7
|
* FindOpenGL: simplify OS selection codeRolf Eike Beer2013-04-171-91/+82
| | | | | | This was using nested if's, now it uses elseif to flatten that. It also removes one "if" from the general "else" branch that checks for Apple, as that has it's own branch anyway and can't be true at this point.
* FindOpenGL: add Haiku pathsRolf Eike Beer2013-01-071-9/+21
| | | | Also check the HP-UX specific paths only when on HP-UX.
* Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()Rolf Eike Beer2012-11-041-1/+1
| | | | | | This solves a lots of warnings, e.g. in the FindModulesExecuteAll test. If the installed version on the system is rather old this may even lead to bugs, e.g. https://bugs.gentoo.org/show_bug.cgi?id=436540
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-19/+19
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-60/+60
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-6/+6
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Modules: Include builtin FindPackageHandleStandardArgs directlyBrad King2011-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FindPackageHandleStandardArgs module was originally created outside of CMake. It was added for CMake 2.6.0 by commit e118a627 (add a macro FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18). However, it also proliferated into a number of other projects that at the time required only CMake 2.4 and thus could not depend on CMake to provide the module. CMake's own find modules started using the module in commit b5f656e0 (use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX modules..., 2007-07-18). Then commit d358cf5c (add 2nd, more powerful mode to find_package_handle_standard_args, 2010-07-29) added a new feature to the interface of the module that was fully optional and backward compatible with all existing users of the module. Later commit 5f183caa (FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly thereafter started using the new interface in CMake's own find modules. This change was also backward compatible because it was only an implementation detail within each module. Unforutnately these changes introduced a problem for projects that still have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH. When any such project uses one of CMake's builtin find modules the line include(FindPackageHandleStandardArgs) loads the copy from the project which does not have the new interface! Then the including find module tries to use the new interface with the old module and fails. Whether this breakage can be considered a backward incompatible change in CMake is debatable. The situation is analagous to copying a standard library header from one version of a compiler into a project and then observing problems when the next version of the compiler reports errors in its other headers that depend on its new version of the original header. Nevertheless it is a change to CMake that causes problems for projects that worked with previous versions. This problem was discovered during the 2.8.3 release candidate cycle. It is an instance of a more general problem with projects that provide their own versions of CMake modules when other CMake modules depend on them. At the time we resolved this instance of the problem with commit b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake everywhere, 2010-09-28) for the 2.8.3 release. In order to address the more general problem we introduced policy CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including from CMAKE_ROOT, 2010-11-17). That change was followed by commit ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017, 2010-12-20) which reverted the original workaround in favor of using the policy. However, existing project releases do not set the policy behavior to NEW and therefore still exhibit the problem. We introduced in commit a364daf1 (Allow users to specify defaults for unset policies, 2011-01-03) an option for users to build existing projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command line. Unfortunately this solution still does not allow such projects to build out of the box, and there is no good way to suggest the use of the new option. The only remaining solution to keep existing projects that exhibit this problem building is to restore the change originally made in commit b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake everywhere, 2010-09-28). This also avoids policy CMP0017 warnings for this particular instance of the problem the policy addresses.
* Use FPHSA in FindOpenGLBen Boeckel2010-12-081-4/+5
| | | | This gets FindOpenGL to obey the QUIET and REQUIRED options correctly.
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Convert CMake find-modules to BSD LicenseBrad King2009-09-281-0/+13
| | | | | | | This adds copyright/license notification blocks CMake's find-modules. Many of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* ENH: add path for 64 bit on old hpBill Hoffman2009-06-151-1/+3
|
* ENH: add more search paths on HPUXBill Hoffman2009-06-151-0/+8
|
* BUG: fix for bug 7104 look for GL in X11R6 dirsBill Hoffman2008-08-191-4/+4
|
* STYLE: remove unnecessary default search pathsAlexander Neundorf2007-08-101-26/+4
| | | | Alex
* STYLE: don't test twice for APPLEAlexander Neundorf2007-07-031-71/+73
| | | | Alex
* ENH: On apple do not look for X11Andy Cedilnik2006-07-051-0/+2
|
* ENH: Do not search for X11 if it is already found.Brad King2006-06-191-1/+3
|
* ENH: go back to finding the framework opengl on the macBill Hoffman2006-03-141-3/+1
|
* ENH: use standard include path for OpenGLBill Hoffman2006-03-141-1/+3
|
* ENH: take advantage of new framework stuffBill Hoffman2006-03-111-2/+3
|
* ENH: cleanupsKen Martin2005-12-151-4/+4
|
* ENH: add documentation support for modulesBill Hoffman2005-12-141-12/+11
|
* ENH: Removing extra 64-bit search paths. They are now constructed ↵Brad King2005-04-071-7/+1
| | | | automatically from the paths listed.
* ENH: Adding support for 64-bit library paths. Contributed by Peter Vanroose.Brad King2005-04-071-1/+7
|
* Fix for bug Bug #1287 - cmake use MesaGL by default instead of libGL - ↵Bill Hoffman2005-04-051-2/+2
| | | | Return to bug list
* ENH: Cleanup. Use relative path to modulesAndy Cedilnik2004-08-271-1/+1
|