Warning, /geant4/cmake/Modules/FindXQuartzGL.cmake is written in an unsupported language. File is not indexed.
0001 #[=======================================================================[.rst:
0002 FindXQuartzGL
0003 -------------
0004
0005 FindModule for XQuartz/Homebrew/MacPorts implementation of OpenGL/GLU. Specific
0006 to Geant4 to allow use of XQuartz/Homebrew/MacPorts only.
0007
0008 Use of the module on non-macOS systems will result in a fatal error
0009
0010 IMPORTED Targets
0011 ^^^^^^^^^^^^^^^^
0012
0013 This module defines the :prop_tgt:`IMPORTED` targets:
0014
0015 ``XQuartz::GL``
0016 Defined to the XQuartz GL library
0017 ``XQuartz::GLU``
0018 Define to the XQuartz GLU library
0019
0020 Result Variables
0021 ^^^^^^^^^^^^^^^^
0022
0023 This module sets the following variables:
0024
0025 ``XQuartzGL_FOUND``
0026 True, if the XQuartz GL libraries were located
0027
0028 Cache Variables
0029 ^^^^^^^^^^^^^^^
0030
0031 The following cache variables may also be set
0032
0033 ``XQuartzGL_INCLUDE_DIR``
0034 Path to the XQuartz GL include directory
0035 ``XQuartzGL_gl_LIBRARY``
0036 Path to the XQuartz GL library
0037 ``XQuartzGL_glu_LIBRARY``
0038 Path to the XQuartz GLU library
0039
0040 #]=======================================================================]
0041
0042 # Just don't run if we're on macOS
0043 if(NOT APPLE)
0044 message(FATAL_ERROR "FindXQuartzGL is only for use on macOS platforms")
0045 endif()
0046
0047 # - This is for X11 GL drivers, so we DON'T want Framework!
0048 set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
0049 set(CMAKE_FIND_FRAMEWORK NEVER)
0050
0051 find_path(XQuartzGL_INCLUDE_DIR GL/gl.h
0052 PATHS /usr/X11R6/include /opt/X11/include /usr/local/include /opt/local/include
0053 NO_DEFAULT_PATH
0054 )
0055
0056 find_library(XQuartzGL_gl_LIBRARY GL
0057 PATHS /usr/X11R6/lib /opt/X11/lib /usr/local/lib /opt/local/lib
0058 NO_DEFAULT_PATH
0059 )
0060
0061 find_library(XQuartzGL_glu_LIBRARY GLU
0062 PATHS /usr/X11R6/lib /opt/X11/lib /usr/local/lib /opt/local/lib
0063 NO_DEFAULT_PATH
0064 )
0065
0066 set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
0067
0068 include(FindPackageHandleStandardArgs)
0069 find_package_handle_standard_args(XQuartzGL
0070 FOUND_VAR
0071 XQuartzGL_FOUND
0072 REQUIRED_VARS
0073 XQuartzGL_INCLUDE_DIR
0074 XQuartzGL_gl_LIBRARY
0075 )
0076
0077 mark_as_advanced(XQuartzGL_INCLUDE_DIR XQuartzGL_gl_LIBRARY XQuartzGL_glu_LIBRARY)
0078
0079 if(XQuartzGL_FOUND)
0080 if(NOT TARGET XQuartzGL::GL)
0081 add_library(XQuartzGL::GL UNKNOWN IMPORTED)
0082 set_target_properties(XQuartzGL::GL PROPERTIES
0083 INTERFACE_INCLUDE_DIRECTORIES "${XQuartzGL_INCLUDE_DIR}"
0084 IMPORTED_LOCATION "${XQuartzGL_gl_LIBRARY}"
0085 )
0086 endif()
0087
0088 if(NOT TARGET XQuartzGL::GLU AND XQuartzGL_glu_LIBRARY)
0089 add_library(XQuartzGL::GLU UNKNOWN IMPORTED)
0090 set_target_properties(XQuartzGL::GLU PROPERTIES
0091 INTERFACE_INCLUDE_DIRECTORIES "${XQuartzGL_INCLUDE_DIR}"
0092 INTERFACE_LINK_LIBRARIES XQuartzGL::GL
0093 IMPORTED_LOCATION "${XQuartzGL_glu_LIBRARY}"
0094 )
0095 endif()
0096 endif()