diff options
author | fuzzard <fuzzard@kodi.tv> | 2024-05-12 12:55:51 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2024-06-22 13:17:13 +1000 |
commit | 33b4f017cf8e18e6704e2ccd85e59fdd51f09058 (patch) | |
tree | 7d3123069eb0e1a8d99ae7828bd4ee5520b0e3a4 | |
parent | 93fd9d98dbfeb34c1e71140291f8fac58f53cb32 (diff) |
[cmake][modules] FindOpenGl cleanup and use core_target_link_libraries
-rw-r--r-- | cmake/modules/FindOpenGl.cmake | 21 | ||||
-rw-r--r-- | xbmc/cores/RetroPlayer/buffers/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/cores/RetroPlayer/rendering/VideoRenderers/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/guilib/CMakeLists.txt | 4 | ||||
-rw-r--r-- | xbmc/pictures/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/rendering/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/rendering/gl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/utils/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/video/dialogs/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/windowing/X11/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/windowing/gbm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/windowing/osx/OpenGL/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/windowing/wayland/CMakeLists.txt | 2 |
16 files changed, 30 insertions, 33 deletions
diff --git a/cmake/modules/FindOpenGl.cmake b/cmake/modules/FindOpenGl.cmake index 1af7469e18..57cae1597c 100644 --- a/cmake/modules/FindOpenGl.cmake +++ b/cmake/modules/FindOpenGl.cmake @@ -5,9 +5,9 @@ # # This will define the following target: # -# OpenGL::GL - The OpenGL library +# ${APP_NAME_LC}::OpenGl - The OpenGL library -if(NOT TARGET OpenGL::GL) +if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME}) find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(PC_OPENGL gl QUIET) @@ -15,22 +15,19 @@ if(NOT TARGET OpenGL::GL) find_library(OPENGL_gl_LIBRARY NAMES GL OpenGL HINTS ${PC_OPENGL_gl_LIBDIR} ${CMAKE_OSX_SYSROOT}/System/Library - PATH_SUFFIXES Frameworks - NO_CACHE) + PATH_SUFFIXES Frameworks) find_path(OPENGL_INCLUDE_DIR NAMES GL/gl.h gl.h - HINTS ${PC_OPENGL_gl_INCLUDEDIR} ${OPENGL_gl_LIBRARY}/Headers - NO_CACHE) + HINTS ${PC_OPENGL_gl_INCLUDEDIR} ${OPENGL_gl_LIBRARY}/Headers) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpenGl REQUIRED_VARS OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) if(OPENGL_FOUND) - add_library(OpenGL::GL UNKNOWN IMPORTED) - set_target_properties(OpenGL::GL PROPERTIES - IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS HAS_GL=1) - set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP OpenGL::GL) + add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED) + set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES + IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAS_GL) endif() endif() diff --git a/xbmc/cores/RetroPlayer/buffers/CMakeLists.txt b/xbmc/cores/RetroPlayer/buffers/CMakeLists.txt index ef66479c46..871af8a897 100644 --- a/xbmc/cores/RetroPlayer/buffers/CMakeLists.txt +++ b/xbmc/cores/RetroPlayer/buffers/CMakeLists.txt @@ -10,14 +10,14 @@ set(HEADERS BaseRenderBuffer.h RenderBufferManager.h ) -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES RenderBufferOpenGLES.cpp RenderBufferPoolOpenGLES.cpp) list(APPEND HEADERS RenderBufferOpenGLES.h RenderBufferPoolOpenGLES.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES RenderBufferOpenGL.cpp RenderBufferPoolOpenGL.cpp) list(APPEND HEADERS RenderBufferOpenGL.h diff --git a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/CMakeLists.txt b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/CMakeLists.txt index 5680b8ec9e..d371b9fab3 100644 --- a/xbmc/cores/RetroPlayer/rendering/VideoRenderers/CMakeLists.txt +++ b/xbmc/cores/RetroPlayer/rendering/VideoRenderers/CMakeLists.txt @@ -8,12 +8,12 @@ if(CORE_SYSTEM_NAME STREQUAL windows) list(APPEND HEADERS RPWinRenderer.h) endif() -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES RPRendererOpenGLES.cpp) list(APPEND HEADERS RPRendererOpenGLES.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES RPRendererOpenGL.cpp) list(APPEND HEADERS RPRendererOpenGL.h) endif() diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt index bc367887af..279693766f 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt @@ -29,12 +29,12 @@ if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) RenderCapture.h) endif() -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES FrameBufferObject.cpp) list(APPEND HEADERS FrameBufferObject.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES LinuxRendererGL.cpp OverlayRendererGL.cpp RenderCaptureGL.cpp) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt index bd4d6333ee..750b7a0bd9 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt @@ -6,7 +6,7 @@ if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) endif() if(VAAPI_FOUND) - if(TARGET OpenGL::GL) + if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES RendererVAAPIGL.cpp) list(APPEND HEADERS RendererVAAPIGL.h) endif() @@ -28,7 +28,7 @@ if(TARGET VDPAU::VDPAU) endif() if(CORE_SYSTEM_NAME STREQUAL osx) - if(TARGET OpenGL::GL) + if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES RendererVTBGL.cpp) list(APPEND HEADERS RendererVTBGL.h) endif() diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt index 5bb02199e7..2b1940927a 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt @@ -14,14 +14,14 @@ if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) endif() -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES ConversionMatrix.cpp ToneMappers.cpp) list(APPEND HEADERS ConversionMatrix.h ToneMappers.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES GLSLOutput.cpp VideoFilterShaderGL.cpp YUV2RGBShaderGL.cpp) diff --git a/xbmc/guilib/CMakeLists.txt b/xbmc/guilib/CMakeLists.txt index d179ee1dcc..78ed07b6cf 100644 --- a/xbmc/guilib/CMakeLists.txt +++ b/xbmc/guilib/CMakeLists.txt @@ -159,11 +159,11 @@ set(HEADERS DDSImage.h XBTF.h XBTFReader.h) -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES Shader.cpp) list(APPEND HEADERS Shader.h) - if(TARGET OpenGL::GL) + if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES GUIFontTTFGL.cpp GUITextureGL.cpp TextureGL.cpp) diff --git a/xbmc/pictures/CMakeLists.txt b/xbmc/pictures/CMakeLists.txt index ee73acad6c..678ba70960 100644 --- a/xbmc/pictures/CMakeLists.txt +++ b/xbmc/pictures/CMakeLists.txt @@ -29,7 +29,7 @@ set(HEADERS interfaces/ISlideShowDelegate.h SlideShowDelegator.h SlideShowPicture.h) -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES SlideShowPictureGL.cpp) list(APPEND HEADERS SlideShowPictureGL.h) endif() diff --git a/xbmc/rendering/CMakeLists.txt b/xbmc/rendering/CMakeLists.txt index 9daaf0c726..b128fe51a7 100644 --- a/xbmc/rendering/CMakeLists.txt +++ b/xbmc/rendering/CMakeLists.txt @@ -3,7 +3,7 @@ set(SOURCES RenderSystem.cpp) set(HEADERS RenderSystem.h RenderSystemTypes.h) -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES MatrixGL.cpp) list(APPEND HEADERS MatrixGL.h) diff --git a/xbmc/rendering/gl/CMakeLists.txt b/xbmc/rendering/gl/CMakeLists.txt index 71c1ee8d32..a6a5b90575 100644 --- a/xbmc/rendering/gl/CMakeLists.txt +++ b/xbmc/rendering/gl/CMakeLists.txt @@ -1,4 +1,4 @@ -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) set(SOURCES RenderSystemGL.cpp ScreenshotSurfaceGL.cpp GLShader.cpp) diff --git a/xbmc/utils/CMakeLists.txt b/xbmc/utils/CMakeLists.txt index d486bcd976..a4de874e0c 100644 --- a/xbmc/utils/CMakeLists.txt +++ b/xbmc/utils/CMakeLists.txt @@ -199,7 +199,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) set_source_files_properties(Mime.cpp PROPERTIES COMPILE_FLAGS -O0) endif() -if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) +if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET OpenGL::GLES) list(APPEND SOURCES GLUtils.cpp) list(APPEND HEADERS GLUtils.h) endif() diff --git a/xbmc/video/dialogs/CMakeLists.txt b/xbmc/video/dialogs/CMakeLists.txt index 15f04c9074..c37b369d70 100644 --- a/xbmc/video/dialogs/CMakeLists.txt +++ b/xbmc/video/dialogs/CMakeLists.txt @@ -24,7 +24,7 @@ set(HEADERS GUIDialogAudioSettings.h GUIDialogVideoOSD.h GUIDialogVideoSettings.h) -if(TARGET OpenGL::GL OR CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) +if(TARGET ${APP_NAME_LC}::OpenGl OR CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) list(APPEND SOURCES GUIDialogCMSSettings.cpp) list(APPEND HEADERS GUIDialogCMSSettings.h) endif() diff --git a/xbmc/windowing/X11/CMakeLists.txt b/xbmc/windowing/X11/CMakeLists.txt index 192d8225ac..33cc4d7720 100644 --- a/xbmc/windowing/X11/CMakeLists.txt +++ b/xbmc/windowing/X11/CMakeLists.txt @@ -23,7 +23,7 @@ if(GLX_FOUND) VideoSyncGLX.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES WinSystemX11GLContext.cpp) list(APPEND HEADERS WinSystemX11GLContext.h) list(APPEND SOURCES VideoSyncOML.cpp) diff --git a/xbmc/windowing/gbm/CMakeLists.txt b/xbmc/windowing/gbm/CMakeLists.txt index 91085f8b7f..84cea44524 100644 --- a/xbmc/windowing/gbm/CMakeLists.txt +++ b/xbmc/windowing/gbm/CMakeLists.txt @@ -14,7 +14,7 @@ set(HEADERS OptionalsReg.h WinSystemGbmEGLContext.h GBMDPMSSupport.h) -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES WinSystemGbmGLContext.cpp) list(APPEND HEADERS WinSystemGbmGLContext.h) endif() diff --git a/xbmc/windowing/osx/OpenGL/CMakeLists.txt b/xbmc/windowing/osx/OpenGL/CMakeLists.txt index 61dc24867f..42600bf6b2 100644 --- a/xbmc/windowing/osx/OpenGL/CMakeLists.txt +++ b/xbmc/windowing/osx/OpenGL/CMakeLists.txt @@ -1,4 +1,4 @@ -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES OSXGLView.mm WindowControllerMacOS.mm WinSystemOSXGL.mm) diff --git a/xbmc/windowing/wayland/CMakeLists.txt b/xbmc/windowing/wayland/CMakeLists.txt index b1ff8a236f..0cfbdee80a 100644 --- a/xbmc/windowing/wayland/CMakeLists.txt +++ b/xbmc/windowing/wayland/CMakeLists.txt @@ -54,7 +54,7 @@ if(TARGET ${APP_NAME_LC}::EGL) list(APPEND HEADERS WinSystemWaylandEGLContext.h) endif() -if(TARGET OpenGL::GL) +if(TARGET ${APP_NAME_LC}::OpenGl) list(APPEND SOURCES WinSystemWaylandEGLContextGL.cpp) list(APPEND HEADERS WinSystemWaylandEGLContextGL.h) endif() |