summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenGL.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Find*: Update *_FOUND variablesPeter Kokot2025-09-231-10/+12
| | | | | | | | | | | | | | | | | | | | | This marks all `<PACKAGENAME>_FOUND` result variables as deprecated where possible (for `<PackageName>` find modules) to make it clearer which variable to use. In CMake 3.3, the FindPackageHandleStandardArgs module was refactored to set both `<PackageName>_FOUND` and uppercase `<PACKAGENAME>_FOUND` result variables to the same values. Before that, the FOUND_VAR argument could be used to set the result variable. * FindMatlab: Uppercased MATLAB_FOUND is not mentioned as it was never documented. * Documentation for FindPythonInterp and FindPythonLibs modules synced accordingly to their deprecation (3.12 instead of 4.2). * OPENGL_FOUND: deprecation version synced with other find modules. * DevIL_FOUND was introduced in CMake 3.8. The uppercased variant not mentioned as it was previously never documented. Fixes: #27242
* FindOpenGL: Update documentationPeter Kokot2025-08-081-70/+187
| | | | | | | | | | | - Added intro code block showing how to use this module. - Added examples section. - Moved CMake versions that introduced specific target or variable to the item instead of above the list, as there are multiple versions and to have option to extend the items further in the future. - Synced the module descriptions a bit with the other find modules. - OpenGL_FOUND variable used (CMake 3.3). Uppercased OPENGL_FOUND is also set to the same value by the find_package_handle_standard_args().
* LICENSE: Replace references to Copyright.txt with LICENSE.rstKitware Robot2025-03-031-1/+1
| | | | | | | | | | ``` git grep -lz 'Copyright.txt or https://cmake.org/licensing ' | while IFS= read -r -d $'\0' f ; do sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / { s/Copyright.txt/LICENSE.rst/ }' "$f" ; done ```
* Help: Use Title Case for all "Imported Targets" sectionsNikita Nemkin2025-01-311-1/+1
|
* Modules/Find*: Include FindPackageHandleStandardArgs normallyBrad King2025-01-301-1/+1
| | | | | | | Since commit d74210a8bd (CMP0017: Remove support for OLD behavior, 2024-11-17) we can rely on CMP0017's NEW behavior unconditionally. Calling `include(FindPackageHandleStandardArgs)` in a builtin module will always get the builtin `FindPackageHandleStandardArgs`.
* Use lower case style for commandsPeter Kokot2025-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where possible this syncs the CS for command names: - check_c_source_compiles() - check_cxx_compiler_flag() - check_cxx_source_compiles() - check_cxx_symbol_exists() - check_include_file_cxx() - check_include_file() - check_include_files() - check_library_exists() - check_source_compiles() - check_struct_has_member() - check_symbol_exists() - check_type_size() - cmake_dependent_option() - cmake_parse_arguments() - feature_summary() - file() - find_package_handle_standard_args() - if(), endif... - install(FILES) - list() - message() - pkg_check_modules() - select_library_configurations() - set_package_info() - test_big_endian()
* FindOpenGL: Add support for a separate GLU include directoryJordan Williams2024-02-051-1/+29
| | | | | | | | | Add a OPENGL_GLU_INCLUDE_DIR cache variable for `GL/glu.h` and attach it as an include directory to the `OpenGL::GLU` target. Also add a `OPENGL_INCLUDE_DIRS` result variable to list all include directories. Account for the GLU header when deciding whether GLU is found. Fixes: #25627
* FindOpenGL: Document how to use macOS X11 OpenGLRandolph M. Fritz2023-12-111-3/+18
| | | | Dicourse-topic: https://discourse.cmake.org/t/9466
* FindOpenGL: Clarify cache entry doc strings on macOSRandolph M. Fritz2023-12-111-5/+8
|
* macOS: Simplify imported framework locations in find modulesBrad King2023-08-251-22/+4
| | | | | | | | | | | | Take advantage of commit d605f728f7 (macOS: Allow IMPORTED_LOCATION to be a framework folder, 2023-06-16) to remove special-case framework logic from find modules. This changes link lines from `/path/to/Foo.framework/Foo[.tbd]` to `-framework Foo`. With the latter, the linker will automatically choose the `.tbd` if it exists. Issue: #24946
* codespell: Fix typosBrad King2023-05-221-1/+1
|
* FindOpenGL: support finding GLES2 and GLES3Jaswant Panchumarti2023-03-101-10/+179
| | | | | This also makes the EGL component not GLVND-specific, so documentation and tests are updated accordingly.
* FindOpenGL: Fix confusing output with CMP0072 and OpenGL preferenceColton G. Rushton2022-08-301-1/+1
| | | | | If the legacy `GL` library is found, report that instead of GLVND's `OpenGL` in the "found" message.
* FindOpenGL: handle GLX without GLVNDBen Boeckel2021-02-261-1/+1
| | | | | | On Ubuntu, installing `libgl-dev` provides `libGL` and `libGLX`, but no `libOpenGL`. Avoid defining GLVND targets without the `OpenGL::OpenGL` target.
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-11/+33
| | | | Issue: #19715
* Merge topic 'FPHSA-name-mismatches-chained-via-include'Brad King2020-08-101-0/+7
|\ | | | | | | | | | | | | | | 98844ec9db FPHSA: detect inclusion between find modules Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Logan Barnes <barneslt63@gmail.com> Merge-request: !5107
| * FPHSA: detect inclusion between find modulesBen Boeckel2020-08-071-0/+7
| | | | | | | | | | | | | | | | | | | | Various find modules include each other to delegate finding some subset or variant of the package. Ideally, these would use `find_dependency` or some other actual `find_package` mechanism, but that is a larger change. Instead, just detect inclusion and suppress FPHSA name mismatch warnings. Fixes: #21060
* | FindOpenGL: Drop Cygwin-specific behavior and use POSIX code pathLemures Lemniscati2020-08-061-13/+1
|/ | | | | | Based on downstream patch from Cygwin package for CMake by Marco Atzeri: * https://github.com/matzeri/cygwin-pkg/blob/64864eb8f0d635ea44226e4b9a41a7ca59a1c7dd/cmake/3.17.3-opengl.patch
* FindOpenGL: only mark declared cache variables as advancedBen Boeckel2020-01-201-11/+32
|
* Merge topic 'update-documentation'Kyle Edwards2019-04-241-3/+3
|\ | | | | | | | | | | | | cb811d11ce Help: Improve description of modules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3222
| * Help: Improve description of modulesBartosz Kosiorek2019-04-231-3/+3
| |
* | FindOpenGL: look for GLVND libraries with a libglvnd suffixBen Boeckel2019-04-171-0/+3
|/ | | | | On CentOS 6.10, the libglvnd package from EPEL installs its libraries under a libglvnd subdirectory.
* 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