diff options
author | Matt Strapp <matt@mattstrapp.net> | 2021-09-20 18:15:14 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2021-09-20 18:15:14 -0500 |
commit | 342403a02f8063903d0f38327430721d4d0ae331 (patch) | |
tree | 29d020a27bc16939c568dd4b29166566d1c0e658 /dev/MinGfx/cmake/AutoBuildOpenGL.cmake | |
parent | Fix parenthesis (diff) | |
download | csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar.gz csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar.bz2 csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar.lz csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar.xz csci4611-342403a02f8063903d0f38327430721d4d0ae331.tar.zst csci4611-342403a02f8063903d0f38327430721d4d0ae331.zip |
do ass1submission-p1.0
Diffstat (limited to '')
-rw-r--r-- | dev/MinGfx/cmake/AutoBuildOpenGL.cmake | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/dev/MinGfx/cmake/AutoBuildOpenGL.cmake b/dev/MinGfx/cmake/AutoBuildOpenGL.cmake index c74b2b8..0148795 100644 --- a/dev/MinGfx/cmake/AutoBuildOpenGL.cmake +++ b/dev/MinGfx/cmake/AutoBuildOpenGL.cmake @@ -1,47 +1,47 @@ -# Author: Daniel F. Keefe -# Copyright 2017,2018, Daniel F. Keefe and Regents of the University of Minnesota -# All Rights Reserved. - - -# Usage: -# AutoBuild_use_package_OpenGL( -# # The 1st argument is required. It is the name of the target you wish to link this dependency to. -# my-program -# -# # The 2nd argument is required. It impacts how dependencies are propogated through CMake. You can treat -# # this dependency as an INTERFACE, PUBLIC, or PRIVATE. See the following URL for details: -# # https://cmake.org/cmake/help/latest/command/target_include_directories.html -# PUBLIC -# ) -# -macro(AutoBuild_use_package_OpenGL YOUR_TARGET INTERFACE_PUBLIC_OR_PRIVATE) - - message(STATUS "AutoBuild: Searching for package OpenGL...") - - # Check to see if the library is already installed on the system - # CMake ships with FindOpenGL.cmake and in CMake 3.9+ it defines - # the imported targets OpenGL::GL and OpenGL::GLU. Using these is - # now the preferred way to link with OpenGL and all of its dependencies. - # See https://cmake.org/cmake/help/v3.9/module/FindOpenGL.html - find_package(OpenGL) - - if (NOT ${OPENGL_FOUND}) - message(FATAL_ERROR "AutoBuild: OpenGL was not found on the system. AutoBuild can auto-download - and build many dependencies for you, but not OpenGL. It should come pre-installed on your system.") - endif() - - message(STATUS "AutoBuild: Ok. Found OpenGL.") - message(STATUS " OpenGL headers: ${OPENGL_INCLUDE_DIR}") - message(STATUS " OpenGL libs: ${OPENGL_LIBRARIES}") - - message(STATUS "Linking target ${YOUR_TARGET} with ${INTERFACE_PUBLIC_OR_PRIVATE} dependency OpenGL::GL.") - target_link_libraries(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} OpenGL::GL) - - if (${OPENGL_GLU_FOUND}) - message(STATUS "Linking target ${YOUR_TARGET} with ${INTERFACE_PUBLIC_OR_PRIVATE} dependency OpenGL::GLU.") - target_link_libraries(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} OpenGL::GLU) - endif() - - target_compile_definitions(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} -DUSE_OPENGL) - -endmacro() +# Author: Daniel F. Keefe
+# Copyright 2017,2018, Daniel F. Keefe and Regents of the University of Minnesota
+# All Rights Reserved.
+
+
+# Usage:
+# AutoBuild_use_package_OpenGL(
+# # The 1st argument is required. It is the name of the target you wish to link this dependency to.
+# my-program
+#
+# # The 2nd argument is required. It impacts how dependencies are propogated through CMake. You can treat
+# # this dependency as an INTERFACE, PUBLIC, or PRIVATE. See the following URL for details:
+# # https://cmake.org/cmake/help/latest/command/target_include_directories.html
+# PUBLIC
+# )
+#
+macro(AutoBuild_use_package_OpenGL YOUR_TARGET INTERFACE_PUBLIC_OR_PRIVATE)
+
+ message(STATUS "AutoBuild: Searching for package OpenGL...")
+
+ # Check to see if the library is already installed on the system
+ # CMake ships with FindOpenGL.cmake and in CMake 3.9+ it defines
+ # the imported targets OpenGL::GL and OpenGL::GLU. Using these is
+ # now the preferred way to link with OpenGL and all of its dependencies.
+ # See https://cmake.org/cmake/help/v3.9/module/FindOpenGL.html
+ find_package(OpenGL)
+
+ if (NOT ${OPENGL_FOUND})
+ message(FATAL_ERROR "AutoBuild: OpenGL was not found on the system. AutoBuild can auto-download
+ and build many dependencies for you, but not OpenGL. It should come pre-installed on your system.")
+ endif()
+
+ message(STATUS "AutoBuild: Ok. Found OpenGL.")
+ message(STATUS " OpenGL headers: ${OPENGL_INCLUDE_DIR}")
+ message(STATUS " OpenGL libs: ${OPENGL_LIBRARIES}")
+
+ message(STATUS "Linking target ${YOUR_TARGET} with ${INTERFACE_PUBLIC_OR_PRIVATE} dependency OpenGL::GL.")
+ target_link_libraries(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} OpenGL::GL)
+
+ if (${OPENGL_GLU_FOUND})
+ message(STATUS "Linking target ${YOUR_TARGET} with ${INTERFACE_PUBLIC_OR_PRIVATE} dependency OpenGL::GLU.")
+ target_link_libraries(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} OpenGL::GLU)
+ endif()
+
+ target_compile_definitions(${YOUR_TARGET} ${INTERFACE_PUBLIC_OR_PRIVATE} -DUSE_OPENGL)
+
+endmacro()
|