Просмотр исходного кода

cmake: Update qrcodegen finder to match target names of CMake package

qrcodegen is built on obs-deps for macOS and Windows, with the
generated CMake package calling the dependency qrcodegen (not
libqrcoden) and associated target qrcodegen::qrcodegen.

This change updates the finder (required for Linux) to create the same
targets so consumers do not need to differentiate between different
variations of the same dependency on Linux.

Also updates obs-websocket to 5.3.1 to bring in associated CMake
changes.
PatTheMav 2 лет назад
Родитель
Сommit
b3949e6aef

+ 0 - 174
cmake/Modules/FindLibqrcodegencpp.cmake

@@ -1,174 +0,0 @@
-#[=======================================================================[.rst
-FindLibqrcodegencpp
--------------------
-
-FindModule for Libqrcodegencpp and associated libraries
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-.. versionadded:: 3.0
-
-This module defines the :prop_tgt:`IMPORTED` target ``Libqrcodegencpp::Libqrcodegencpp``.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This module sets the following variables:
-
-``Libqrcodegencpp_FOUND``
-  True, if all required components and the core library were found.
-``Libqrcodegencpp_VERSION``
-  Detected version of found Libqrcodegencpp libraries.
-
-Cache variables
-^^^^^^^^^^^^^^^
-
-The following cache variables may also be set:
-
-``Libqrcodegencpp_LIBRARY``
-  Path to the library component of Libqrcodegencpp.
-``Libqrcodegencpp_INCLUDE_DIR``
-  Directory containing ``qrcodegen.hpp``.
-
-#]=======================================================================]
-
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-lint: disable=C0301
-# cmake-format: on
-
-include(FindPackageHandleStandardArgs)
-
-find_package(PkgConfig QUIET)
-if(PKG_CONFIG_FOUND)
-  pkg_search_module(PC_Libqrcodegencpp QUIET qrcodegencpp)
-endif()
-
-# Libqrcodegencpp_set_soname: Set SONAME on imported library target
-macro(Libqrcodegencpp_set_soname)
-  if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
-    execute_process(
-      COMMAND sh -c "otool -D '${Libqrcodegencpp_LIBRARY}' | grep -v '${Libqrcodegencpp_LIBRARY}'"
-      OUTPUT_VARIABLE _output
-      RESULT_VARIABLE _result)
-
-    if(_result EQUAL 0 AND _output MATCHES "^@rpath/")
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_SONAME "${_output}")
-    endif()
-  elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
-    execute_process(
-      COMMAND sh -c "${CMAKE_OBJDUMP} -p '${Libqrcodegencpp_LIBRARY}' | grep SONAME"
-      OUTPUT_VARIABLE _output
-      RESULT_VARIABLE _result)
-
-    if(_result EQUAL 0)
-      string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}")
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_SONAME "${_soname}")
-      unset(_soname)
-    endif()
-  endif()
-  unset(_output)
-  unset(_result)
-endmacro()
-
-# Libqrcodegencpp_find_dll: Find DLL for corresponding import library
-macro(Libqrcodegencpp_find_dll)
-  cmake_path(GET Libqrcodegencpp_IMPLIB PARENT_PATH _implib_path)
-  cmake_path(SET _bin_path NORMALIZE "${_implib_path}/../bin")
-
-  string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" _dll_version "${Libqrcodegencpp_VERSION}")
-
-  find_program(
-    Libqrcodegencpp_LIBRARY
-    NAMES qrcodegencpp.dll
-    HINTS ${_implib_path} ${_bin_path}
-    DOC "Libqrcodegencpp DLL location")
-
-  if(NOT Libqrcodegencpp_LIBRARY)
-    set(Libqrcodegencpp_LIBRARY "${Libqrcodegencpp_IMPLIB}")
-  endif()
-  unset(_implib_path)
-  unset(_bin_path)
-  unset(_dll_version)
-endmacro()
-
-find_path(
-  Libqrcodegencpp_INCLUDE_DIR
-  NAMES qrcodegen.hpp
-  HINTS ${PC_Libqrcodegencpp_INCLUDE_DIRS}
-  PATHS /usr/include /usr/local/include
-  PATH_SUFFIXES qrcodegencpp qrcodegen
-  DOC "Libqrcodegencpp include directory")
-
-if(PC_Libqrcodegencpp_VERSION VERSION_GREATER 0)
-  set(Libqrcodegencpp_VERSION ${PC_Libqrcodegencpp_VERSION})
-else()
-  if(NOT Libqrcodegencpp_FIND_QUIETLY)
-    message(AUTHOR_WARNING "Failed to find Libqrcodegencpp version.")
-  endif()
-  set(Libqrcodegencpp_VERSION 0.0.0)
-endif()
-
-if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-  find_library(
-    Libqrcodegencpp_IMPLIB
-    NAMES libqrcodegencpp qrcodegencpp
-    DOC "Libqrcodegencpp import library location")
-
-  libqrcodegencpp_find_dll()
-else()
-  find_library(
-    Libqrcodegencpp_LIBRARY
-    NAMES libqrcodegencpp qrcodegencpp
-    HINTS ${PC_Libqrcodegencpp_LIBRARY_DIRS}
-    PATHS /usr/lib /usr/local/lib
-    DOC "Libqrcodegencpp location")
-endif()
-
-if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
-  set(Libqrcodegencpp_ERROR_REASON "Ensure that a qrcodegencpp distribution is provided as part of CMAKE_PREFIX_PATH.")
-elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
-  set(Libqrcodegencpp_ERROR_REASON "Ensure that qrcodegencpp is installed on the system.")
-endif()
-
-find_package_handle_standard_args(
-  Libqrcodegencpp
-  REQUIRED_VARS Libqrcodegencpp_LIBRARY Libqrcodegencpp_INCLUDE_DIR
-  VERSION_VAR Libqrcodegencpp_VERSION REASON_FAILURE_MESSAGE "${Libqrcodegencpp_ERROR_REASON}")
-mark_as_advanced(Libqrcodegencpp_INCLUDE_DIR Libqrcodegencpp_LIBRARY Libqrcodegencpp_IMPLIB)
-unset(Libqrcodegencpp_ERROR_REASON)
-
-if(Libqrcodegencpp_FOUND)
-  if(NOT TARGET Libqrcodegencpp::Libqrcodegencpp)
-    if(IS_ABSOLUTE "${Libqrcodegencpp_LIBRARY}")
-      if(DEFINED Libqrcodegencpp_IMPLIB)
-        if(Libqrcodegencpp_IMPLIB STREQUAL Libqrcodegencpp_LIBRARY)
-          add_library(Libqrcodegencpp::Libqrcodegencpp STATIC IMPORTED)
-        else()
-          add_library(Libqrcodegencpp::Libqrcodegencpp SHARED IMPORTED)
-          set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_IMPLIB "${Libqrcodegencpp_IMPLIB}")
-        endif()
-      else()
-        add_library(Libqrcodegencpp::Libqrcodegencpp UNKNOWN IMPORTED)
-      endif()
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_LOCATION "${Libqrcodegencpp_LIBRARY}")
-    else()
-      add_library(Libqrcodegencpp::Libqrcodegencpp INTERFACE IMPORTED)
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_LIBNAME "${Libqrcodegencpp_LIBRARY}")
-    endif()
-
-    libqrcodegencpp_set_soname()
-    set_target_properties(
-      Libqrcodegencpp::Libqrcodegencpp
-      PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_Libqrcodegencpp_CFLAGS_OTHER}"
-                 INTERFACE_INCLUDE_DIRECTORIES "${Libqrcodegencpp_INCLUDE_DIR}"
-                 VERSION ${Libqrcodegencpp_VERSION})
-  endif()
-endif()
-
-include(FeatureSummary)
-set_package_properties(
-  Libqrcodegencpp PROPERTIES
-  URL "https://www.nayuki.io/page/qr-code-generator-library"
-  DESCRIPTION "This project aims to be the best, clearest library for generating QR Codes in C++.")

+ 174 - 0
cmake/Modules/Findqrcodegencpp.cmake

@@ -0,0 +1,174 @@
+#[=======================================================================[.rst
+Findqrcodegencpp
+----------------
+
+FindModule for qrcodegencpp and associated libraries
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.0
+
+This module defines the :prop_tgt:`IMPORTED` target ``qrcodegencpp::qrcodegencpp``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+``qrcodegencpp_FOUND``
+  True, if all required components and the core library were found.
+``qrcodegencpp_VERSION``
+  Detected version of found qrcodegencpp libraries.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``qrcodegencpp_LIBRARY``
+  Path to the library component of qrcodegencpp.
+``qrcodegencpp_INCLUDE_DIR``
+  Directory containing ``qrcodegen.hpp``.
+
+#]=======================================================================]
+
+# cmake-format: off
+# cmake-lint: disable=C0103
+# cmake-lint: disable=C0301
+# cmake-format: on
+
+include(FindPackageHandleStandardArgs)
+
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+  pkg_search_module(PC_qrcodegencpp QUIET qrcodegencpp)
+endif()
+
+# qrcodegencpp_set_soname: Set SONAME on imported library target
+macro(qrcodegencpp_set_soname)
+  if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+    execute_process(
+      COMMAND sh -c "otool -D '${qrcodegencpp_LIBRARY}' | grep -v '${qrcodegencpp_LIBRARY}'"
+      OUTPUT_VARIABLE _output
+      RESULT_VARIABLE _result)
+
+    if(_result EQUAL 0 AND _output MATCHES "^@rpath/")
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_SONAME "${_output}")
+    endif()
+  elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
+    execute_process(
+      COMMAND sh -c "${CMAKE_OBJDUMP} -p '${qrcodegencpp_LIBRARY}' | grep SONAME"
+      OUTPUT_VARIABLE _output
+      RESULT_VARIABLE _result)
+
+    if(_result EQUAL 0)
+      string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}")
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_SONAME "${_soname}")
+      unset(_soname)
+    endif()
+  endif()
+  unset(_output)
+  unset(_result)
+endmacro()
+
+# qrcodegencpp_find_dll: Find DLL for corresponding import library
+macro(qrcodegencpp_find_dll)
+  cmake_path(GET qrcodegencpp_IMPLIB PARENT_PATH _implib_path)
+  cmake_path(SET _bin_path NORMALIZE "${_implib_path}/../bin")
+
+  string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" _dll_version "${qrcodegencpp_VERSION}")
+
+  find_program(
+    qrcodegencpp_LIBRARY
+    NAMES qrcodegencpp.dll
+    HINTS ${_implib_path} ${_bin_path}
+    DOC "qrcodegencpp DLL location")
+
+  if(NOT qrcodegencpp_LIBRARY)
+    set(qrcodegencpp_LIBRARY "${qrcodegencpp_IMPLIB}")
+  endif()
+  unset(_implib_path)
+  unset(_bin_path)
+  unset(_dll_version)
+endmacro()
+
+find_path(
+  qrcodegencpp_INCLUDE_DIR
+  NAMES qrcodegen.hpp
+  HINTS ${PC_qrcodegencpp_INCLUDE_DIRS}
+  PATHS /usr/include /usr/local/include
+  PATH_SUFFIXES qrcodegencpp qrcodegen
+  DOC "qrcodegencpp include directory")
+
+if(PC_qrcodegencpp_VERSION VERSION_GREATER 0)
+  set(qrcodegencpp_VERSION ${PC_qrcodegencpp_VERSION})
+else()
+  if(NOT qrcodegencpp_FIND_QUIETLY)
+    message(AUTHOR_WARNING "Failed to find qrcodegencpp version.")
+  endif()
+  set(qrcodegencpp_VERSION 0.0.0)
+endif()
+
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+  find_library(
+    qrcodegencpp_IMPLIB
+    NAMES qrcodegencpp qrcodegencpp
+    DOC "qrcodegencpp import library location")
+
+  qrcodegencpp_find_dll()
+else()
+  find_library(
+    qrcodegencpp_LIBRARY
+    NAMES qrcodegencpp qrcodegencpp
+    HINTS ${PC_qrcodegencpp_LIBRARY_DIRS}
+    PATHS /usr/lib /usr/local/lib
+    DOC "qrcodegencpp location")
+endif()
+
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
+  set(qrcodegencpp_ERROR_REASON "Ensure that a qrcodegencpp distribution is provided as part of CMAKE_PREFIX_PATH.")
+elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
+  set(qrcodegencpp_ERROR_REASON "Ensure that qrcodegencpp is installed on the system.")
+endif()
+
+find_package_handle_standard_args(
+  qrcodegencpp
+  REQUIRED_VARS qrcodegencpp_LIBRARY qrcodegencpp_INCLUDE_DIR
+  VERSION_VAR qrcodegencpp_VERSION REASON_FAILURE_MESSAGE "${qrcodegencpp_ERROR_REASON}")
+mark_as_advanced(qrcodegencpp_INCLUDE_DIR qrcodegencpp_LIBRARY qrcodegencpp_IMPLIB)
+unset(qrcodegencpp_ERROR_REASON)
+
+if(qrcodegencpp_FOUND)
+  if(NOT TARGET qrcodegencpp::qrcodegencpp)
+    if(IS_ABSOLUTE "${qrcodegencpp_LIBRARY}")
+      if(DEFINED qrcodegencpp_IMPLIB)
+        if(qrcodegencpp_IMPLIB STREQUAL qrcodegencpp_LIBRARY)
+          add_library(qrcodegencpp::qrcodegencpp STATIC IMPORTED)
+        else()
+          add_library(qrcodegencpp::qrcodegencpp SHARED IMPORTED)
+          set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_IMPLIB "${qrcodegencpp_IMPLIB}")
+        endif()
+      else()
+        add_library(qrcodegencpp::qrcodegencpp UNKNOWN IMPORTED)
+      endif()
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_LOCATION "${qrcodegencpp_LIBRARY}")
+    else()
+      add_library(qrcodegencpp::qrcodegencpp INTERFACE IMPORTED)
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_LIBNAME "${qrcodegencpp_LIBRARY}")
+    endif()
+
+    qrcodegencpp_set_soname()
+    set_target_properties(
+      qrcodegencpp::qrcodegencpp
+      PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_qrcodegencpp_CFLAGS_OTHER}"
+                 INTERFACE_INCLUDE_DIRECTORIES "${qrcodegencpp_INCLUDE_DIR}"
+                 VERSION ${qrcodegencpp_VERSION})
+  endif()
+endif()
+
+include(FeatureSummary)
+set_package_properties(
+  qrcodegencpp PROPERTIES
+  URL "https://www.nayuki.io/page/qr-code-generator-library"
+  DESCRIPTION "This project aims to be the best, clearest library for generating QR Codes in C++.")

+ 4 - 0
cmake/common/bootstrap.cmake

@@ -27,6 +27,10 @@ if(POLICY CMP0090)
   cmake_policy(SET CMP0090 NEW)
 endif()
 
+set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release MinSizeRel "")
+set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release RelWithDebInfo "")
+set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel "")
+
 # Prohibit in-source builds
 if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   message(FATAL_ERROR "In-source builds of OBS are not supported. "

+ 0 - 174
cmake/finders/FindLibqrcodegencpp.cmake

@@ -1,174 +0,0 @@
-#[=======================================================================[.rst
-FindLibqrcodegencpp
--------------------
-
-FindModule for Libqrcodegencpp and associated libraries
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-.. versionadded:: 3.0
-
-This module defines the :prop_tgt:`IMPORTED` target ``Libqrcodegencpp::Libqrcodegencpp``.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This module sets the following variables:
-
-``Libqrcodegencpp_FOUND``
-  True, if all required components and the core library were found.
-``Libqrcodegencpp_VERSION``
-  Detected version of found Libqrcodegencpp libraries.
-
-Cache variables
-^^^^^^^^^^^^^^^
-
-The following cache variables may also be set:
-
-``Libqrcodegencpp_LIBRARY``
-  Path to the library component of Libqrcodegencpp.
-``Libqrcodegencpp_INCLUDE_DIR``
-  Directory containing ``qrcodegen.hpp``.
-
-#]=======================================================================]
-
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-lint: disable=C0301
-# cmake-format: on
-
-include(FindPackageHandleStandardArgs)
-
-find_package(PkgConfig QUIET)
-if(PKG_CONFIG_FOUND)
-  pkg_search_module(PC_Libqrcodegencpp QUIET qrcodegencpp)
-endif()
-
-# Libqrcodegencpp_set_soname: Set SONAME on imported library target
-macro(Libqrcodegencpp_set_soname)
-  if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
-    execute_process(
-      COMMAND sh -c "otool -D '${Libqrcodegencpp_LIBRARY}' | grep -v '${Libqrcodegencpp_LIBRARY}'"
-      OUTPUT_VARIABLE _output
-      RESULT_VARIABLE _result)
-
-    if(_result EQUAL 0 AND _output MATCHES "^@rpath/")
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_SONAME "${_output}")
-    endif()
-  elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
-    execute_process(
-      COMMAND sh -c "${CMAKE_OBJDUMP} -p '${Libqrcodegencpp_LIBRARY}' | grep SONAME"
-      OUTPUT_VARIABLE _output
-      RESULT_VARIABLE _result)
-
-    if(_result EQUAL 0)
-      string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}")
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_SONAME "${_soname}")
-      unset(_soname)
-    endif()
-  endif()
-  unset(_output)
-  unset(_result)
-endmacro()
-
-# Libqrcodegencpp_find_dll: Find DLL for corresponding import library
-macro(Libqrcodegencpp_find_dll)
-  cmake_path(GET Libqrcodegencpp_IMPLIB PARENT_PATH _implib_path)
-  cmake_path(SET _bin_path NORMALIZE "${_implib_path}/../bin")
-
-  string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" _dll_version "${Libqrcodegencpp_VERSION}")
-
-  find_program(
-    Libqrcodegencpp_LIBRARY
-    NAMES qrcodegencpp.dll
-    HINTS ${_implib_path} ${_bin_path}
-    DOC "Libqrcodegencpp DLL location")
-
-  if(NOT Libqrcodegencpp_LIBRARY)
-    set(Libqrcodegencpp_LIBRARY "${Libqrcodegencpp_IMPLIB}")
-  endif()
-  unset(_implib_path)
-  unset(_bin_path)
-  unset(_dll_version)
-endmacro()
-
-find_path(
-  Libqrcodegencpp_INCLUDE_DIR
-  NAMES qrcodegen.hpp
-  HINTS ${PC_Libqrcodegencpp_INCLUDE_DIRS}
-  PATHS /usr/include /usr/local/include
-  PATH_SUFFIXES qrcodegencpp qrcodegen
-  DOC "Libqrcodegencpp include directory")
-
-if(PC_Libqrcodegencpp_VERSION VERSION_GREATER 0)
-  set(Libqrcodegencpp_VERSION ${PC_Libqrcodegencpp_VERSION})
-else()
-  if(NOT Libqrcodegencpp_FIND_QUIETLY)
-    message(AUTHOR_WARNING "Failed to find Libqrcodegencpp version.")
-  endif()
-  set(Libqrcodegencpp_VERSION 0.0.0)
-endif()
-
-if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-  find_library(
-    Libqrcodegencpp_IMPLIB
-    NAMES libqrcodegencpp qrcodegencpp
-    DOC "Libqrcodegencpp import library location")
-
-  libqrcodegencpp_find_dll()
-else()
-  find_library(
-    Libqrcodegencpp_LIBRARY
-    NAMES libqrcodegencpp qrcodegencpp
-    HINTS ${PC_Libqrcodegencpp_LIBRARY_DIRS}
-    PATHS /usr/lib /usr/local/lib
-    DOC "Libqrcodegencpp location")
-endif()
-
-if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
-  set(Libqrcodegencpp_ERROR_REASON "Ensure that a qrcodegencpp distribution is provided as part of CMAKE_PREFIX_PATH.")
-elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
-  set(Libqrcodegencpp_ERROR_REASON "Ensure that qrcodegencpp is installed on the system.")
-endif()
-
-find_package_handle_standard_args(
-  Libqrcodegencpp
-  REQUIRED_VARS Libqrcodegencpp_LIBRARY Libqrcodegencpp_INCLUDE_DIR
-  VERSION_VAR Libqrcodegencpp_VERSION REASON_FAILURE_MESSAGE "${Libqrcodegencpp_ERROR_REASON}")
-mark_as_advanced(Libqrcodegencpp_INCLUDE_DIR Libqrcodegencpp_LIBRARY Libqrcodegencpp_IMPLIB)
-unset(Libqrcodegencpp_ERROR_REASON)
-
-if(Libqrcodegencpp_FOUND)
-  if(NOT TARGET Libqrcodegencpp::Libqrcodegencpp)
-    if(IS_ABSOLUTE "${Libqrcodegencpp_LIBRARY}")
-      if(DEFINED Libqrcodegencpp_IMPLIB)
-        if(Libqrcodegencpp_IMPLIB STREQUAL Libqrcodegencpp_LIBRARY)
-          add_library(Libqrcodegencpp::Libqrcodegencpp STATIC IMPORTED)
-        else()
-          add_library(Libqrcodegencpp::Libqrcodegencpp SHARED IMPORTED)
-          set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_IMPLIB "${Libqrcodegencpp_IMPLIB}")
-        endif()
-      else()
-        add_library(Libqrcodegencpp::Libqrcodegencpp UNKNOWN IMPORTED)
-      endif()
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_LOCATION "${Libqrcodegencpp_LIBRARY}")
-    else()
-      add_library(Libqrcodegencpp::Libqrcodegencpp INTERFACE IMPORTED)
-      set_property(TARGET Libqrcodegencpp::Libqrcodegencpp PROPERTY IMPORTED_LIBNAME "${Libqrcodegencpp_LIBRARY}")
-    endif()
-
-    libqrcodegencpp_set_soname()
-    set_target_properties(
-      Libqrcodegencpp::Libqrcodegencpp
-      PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_Libqrcodegencpp_CFLAGS_OTHER}"
-                 INTERFACE_INCLUDE_DIRECTORIES "${Libqrcodegencpp_INCLUDE_DIR}"
-                 VERSION ${Libqrcodegencpp_VERSION})
-  endif()
-endif()
-
-include(FeatureSummary)
-set_package_properties(
-  Libqrcodegencpp PROPERTIES
-  URL "https://www.nayuki.io/page/qr-code-generator-library"
-  DESCRIPTION "This project aims to be the best, clearest library for generating QR Codes in C++.")

+ 174 - 0
cmake/finders/Findqrcodegencpp.cmake

@@ -0,0 +1,174 @@
+#[=======================================================================[.rst
+Findqrcodegencpp
+----------------
+
+FindModule for qrcodegencpp and associated libraries
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.0
+
+This module defines the :prop_tgt:`IMPORTED` target ``qrcodegencpp::qrcodegencpp``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+``qrcodegencpp_FOUND``
+  True, if all required components and the core library were found.
+``qrcodegencpp_VERSION``
+  Detected version of found qrcodegencpp libraries.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``qrcodegencpp_LIBRARY``
+  Path to the library component of qrcodegencpp.
+``qrcodegencpp_INCLUDE_DIR``
+  Directory containing ``qrcodegen.hpp``.
+
+#]=======================================================================]
+
+# cmake-format: off
+# cmake-lint: disable=C0103
+# cmake-lint: disable=C0301
+# cmake-format: on
+
+include(FindPackageHandleStandardArgs)
+
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+  pkg_search_module(PC_qrcodegencpp QUIET qrcodegencpp)
+endif()
+
+# qrcodegencpp_set_soname: Set SONAME on imported library target
+macro(qrcodegencpp_set_soname)
+  if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+    execute_process(
+      COMMAND sh -c "otool -D '${qrcodegencpp_LIBRARY}' | grep -v '${qrcodegencpp_LIBRARY}'"
+      OUTPUT_VARIABLE _output
+      RESULT_VARIABLE _result)
+
+    if(_result EQUAL 0 AND _output MATCHES "^@rpath/")
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_SONAME "${_output}")
+    endif()
+  elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
+    execute_process(
+      COMMAND sh -c "${CMAKE_OBJDUMP} -p '${qrcodegencpp_LIBRARY}' | grep SONAME"
+      OUTPUT_VARIABLE _output
+      RESULT_VARIABLE _result)
+
+    if(_result EQUAL 0)
+      string(REGEX REPLACE "[ \t]+SONAME[ \t]+([^ \t]+)" "\\1" _soname "${_output}")
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_SONAME "${_soname}")
+      unset(_soname)
+    endif()
+  endif()
+  unset(_output)
+  unset(_result)
+endmacro()
+
+# qrcodegencpp_find_dll: Find DLL for corresponding import library
+macro(qrcodegencpp_find_dll)
+  cmake_path(GET qrcodegencpp_IMPLIB PARENT_PATH _implib_path)
+  cmake_path(SET _bin_path NORMALIZE "${_implib_path}/../bin")
+
+  string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" _dll_version "${qrcodegencpp_VERSION}")
+
+  find_program(
+    qrcodegencpp_LIBRARY
+    NAMES qrcodegencpp.dll
+    HINTS ${_implib_path} ${_bin_path}
+    DOC "qrcodegencpp DLL location")
+
+  if(NOT qrcodegencpp_LIBRARY)
+    set(qrcodegencpp_LIBRARY "${qrcodegencpp_IMPLIB}")
+  endif()
+  unset(_implib_path)
+  unset(_bin_path)
+  unset(_dll_version)
+endmacro()
+
+find_path(
+  qrcodegencpp_INCLUDE_DIR
+  NAMES qrcodegen.hpp
+  HINTS ${PC_qrcodegencpp_INCLUDE_DIRS}
+  PATHS /usr/include /usr/local/include
+  PATH_SUFFIXES qrcodegencpp qrcodegen
+  DOC "qrcodegencpp include directory")
+
+if(PC_qrcodegencpp_VERSION VERSION_GREATER 0)
+  set(qrcodegencpp_VERSION ${PC_qrcodegencpp_VERSION})
+else()
+  if(NOT qrcodegencpp_FIND_QUIETLY)
+    message(AUTHOR_WARNING "Failed to find qrcodegencpp version.")
+  endif()
+  set(qrcodegencpp_VERSION 0.0.0)
+endif()
+
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+  find_library(
+    qrcodegencpp_IMPLIB
+    NAMES qrcodegencpp qrcodegencpp
+    DOC "qrcodegencpp import library location")
+
+  qrcodegencpp_find_dll()
+else()
+  find_library(
+    qrcodegencpp_LIBRARY
+    NAMES qrcodegencpp qrcodegencpp
+    HINTS ${PC_qrcodegencpp_LIBRARY_DIRS}
+    PATHS /usr/lib /usr/local/lib
+    DOC "qrcodegencpp location")
+endif()
+
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
+  set(qrcodegencpp_ERROR_REASON "Ensure that a qrcodegencpp distribution is provided as part of CMAKE_PREFIX_PATH.")
+elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
+  set(qrcodegencpp_ERROR_REASON "Ensure that qrcodegencpp is installed on the system.")
+endif()
+
+find_package_handle_standard_args(
+  qrcodegencpp
+  REQUIRED_VARS qrcodegencpp_LIBRARY qrcodegencpp_INCLUDE_DIR
+  VERSION_VAR qrcodegencpp_VERSION REASON_FAILURE_MESSAGE "${qrcodegencpp_ERROR_REASON}")
+mark_as_advanced(qrcodegencpp_INCLUDE_DIR qrcodegencpp_LIBRARY qrcodegencpp_IMPLIB)
+unset(qrcodegencpp_ERROR_REASON)
+
+if(qrcodegencpp_FOUND)
+  if(NOT TARGET qrcodegencpp::qrcodegencpp)
+    if(IS_ABSOLUTE "${qrcodegencpp_LIBRARY}")
+      if(DEFINED qrcodegencpp_IMPLIB)
+        if(qrcodegencpp_IMPLIB STREQUAL qrcodegencpp_LIBRARY)
+          add_library(qrcodegencpp::qrcodegencpp STATIC IMPORTED)
+        else()
+          add_library(qrcodegencpp::qrcodegencpp SHARED IMPORTED)
+          set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_IMPLIB "${qrcodegencpp_IMPLIB}")
+        endif()
+      else()
+        add_library(qrcodegencpp::qrcodegencpp UNKNOWN IMPORTED)
+      endif()
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_LOCATION "${qrcodegencpp_LIBRARY}")
+    else()
+      add_library(qrcodegencpp::qrcodegencpp INTERFACE IMPORTED)
+      set_property(TARGET qrcodegencpp::qrcodegencpp PROPERTY IMPORTED_LIBNAME "${qrcodegencpp_LIBRARY}")
+    endif()
+
+    qrcodegencpp_set_soname()
+    set_target_properties(
+      qrcodegencpp::qrcodegencpp
+      PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_qrcodegencpp_CFLAGS_OTHER}"
+                 INTERFACE_INCLUDE_DIRECTORIES "${qrcodegencpp_INCLUDE_DIR}"
+                 VERSION ${qrcodegencpp_VERSION})
+  endif()
+endif()
+
+include(FeatureSummary)
+set_package_properties(
+  qrcodegencpp PROPERTIES
+  URL "https://www.nayuki.io/page/qr-code-generator-library"
+  DESCRIPTION "This project aims to be the best, clearest library for generating QR Codes in C++.")

+ 1 - 1
plugins/obs-websocket

@@ -1 +1 @@
-Subproject commit ec2cdc84759d737e8612fdd0b3c3fcec6ac89761
+Subproject commit e9c0eee9e4c48337c59af0f3e871f3801a9c35f0