aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2022-04-09 00:28:42 +0200
committerMarvin W <git@larma.de>2022-04-09 00:28:42 +0200
commitbaa4a6a1eb4e98558acfef6e2a24c2c13d42db5c (patch)
treefd5189f181a4a957cd651331bb928b3d68c90754 /cmake
parenta0eac798cd1a1abf20772db9f89c54e945ded3ea (diff)
downloaddino-baa4a6a1eb4e98558acfef6e2a24c2c13d42db5c.tar.gz
dino-baa4a6a1eb4e98558acfef6e2a24c2c13d42db5c.zip
Prepare http-files plugin for libsoup-3 support
Note: ice plugin still depends on libsoup-2.4 and one can't have both in the same process, so this remains disabled by default
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindSoup.cmake31
-rw-r--r--cmake/FindSoup2.cmake31
-rw-r--r--cmake/FindSoup3.cmake31
3 files changed, 62 insertions, 31 deletions
diff --git a/cmake/FindSoup.cmake b/cmake/FindSoup.cmake
deleted file mode 100644
index d5afab48..00000000
--- a/cmake/FindSoup.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-include(PkgConfigWithFallback)
-find_pkg_config_with_fallback(Soup
- PKG_CONFIG_NAME libsoup-2.4
- LIB_NAMES soup-2.4
- INCLUDE_NAMES libsoup/soup.h
- INCLUDE_DIR_SUFFIXES libsoup-2.4 libsoup-2.4/include libsoup libsoup/include
- DEPENDS GIO
-)
-
-if(Soup_FOUND AND NOT Soup_VERSION)
- find_file(Soup_VERSION_HEADER "libsoup/soup-version.h" HINTS ${Soup_INCLUDE_DIRS})
- mark_as_advanced(Soup_VERSION_HEADER)
-
- if(Soup_VERSION_HEADER)
- file(STRINGS "${Soup_VERSION_HEADER}" Soup_MAJOR_VERSION REGEX "^#define SOUP_MAJOR_VERSION +\\(?([0-9]+)\\)?$")
- string(REGEX REPLACE "^#define SOUP_MAJOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MAJOR_VERSION "${Soup_MAJOR_VERSION}")
- file(STRINGS "${Soup_VERSION_HEADER}" Soup_MINOR_VERSION REGEX "^#define SOUP_MINOR_VERSION +\\(?([0-9]+)\\)?$")
- string(REGEX REPLACE "^#define SOUP_MINOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MINOR_VERSION "${Soup_MINOR_VERSION}")
- file(STRINGS "${Soup_VERSION_HEADER}" Soup_MICRO_VERSION REGEX "^#define SOUP_MICRO_VERSION +\\(?([0-9]+)\\)?$")
- string(REGEX REPLACE "^#define SOUP_MICRO_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MICRO_VERSION "${Soup_MICRO_VERSION}")
- set(Soup_VERSION "${Soup_MAJOR_VERSION}.${Soup_MINOR_VERSION}.${Soup_MICRO_VERSION}")
- unset(Soup_MAJOR_VERSION)
- unset(Soup_MINOR_VERSION)
- unset(Soup_MICRO_VERSION)
- endif()
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Soup
- REQUIRED_VARS Soup_LIBRARY
- VERSION_VAR Soup_VERSION)
diff --git a/cmake/FindSoup2.cmake b/cmake/FindSoup2.cmake
new file mode 100644
index 00000000..07ffed14
--- /dev/null
+++ b/cmake/FindSoup2.cmake
@@ -0,0 +1,31 @@
+include(PkgConfigWithFallback)
+find_pkg_config_with_fallback(Soup2
+ PKG_CONFIG_NAME libsoup-2.4
+ LIB_NAMES soup-2.4
+ INCLUDE_NAMES libsoup/soup.h
+ INCLUDE_DIR_SUFFIXES libsoup-2.4 libsoup-2.4/include libsoup libsoup/include
+ DEPENDS GIO
+)
+
+if(Soup2_FOUND AND NOT Soup2_VERSION)
+ find_file(Soup2_VERSION_HEADER "libsoup/soup-version.h" HINTS ${Soup_INCLUDE_DIRS})
+ mark_as_advanced(Soup2_VERSION_HEADER)
+
+ if(Soup_VERSION_HEADER)
+ file(STRINGS "${Soup2_VERSION_HEADER}" Soup2_MAJOR_VERSION REGEX "^#define SOUP_MAJOR_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MAJOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MAJOR_VERSION "${Soup2_MAJOR_VERSION}")
+ file(STRINGS "${Soup2_VERSION_HEADER}" Soup2_MINOR_VERSION REGEX "^#define SOUP_MINOR_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MINOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MINOR_VERSION "${Soup2_MINOR_VERSION}")
+ file(STRINGS "${Soup2_VERSION_HEADER}" Soup2_MICRO_VERSION REGEX "^#define SOUP_MICRO_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MICRO_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup_MICRO_VERSION "${Soup2_MICRO_VERSION}")
+ set(Soup_VERSION "${Soup2_MAJOR_VERSION}.${Soup2_MINOR_VERSION}.${Soup2_MICRO_VERSION}")
+ unset(Soup2_MAJOR_VERSION)
+ unset(Soup2_MINOR_VERSION)
+ unset(Soup2_MICRO_VERSION)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Soup2
+ REQUIRED_VARS Soup2_LIBRARY
+ VERSION_VAR Soup2_VERSION)
diff --git a/cmake/FindSoup3.cmake b/cmake/FindSoup3.cmake
new file mode 100644
index 00000000..07b4893a
--- /dev/null
+++ b/cmake/FindSoup3.cmake
@@ -0,0 +1,31 @@
+include(PkgConfigWithFallback)
+find_pkg_config_with_fallback(Soup3
+ PKG_CONFIG_NAME libsoup-3.0
+ LIB_NAMES soup-3.0
+ INCLUDE_NAMES libsoup/soup.h
+ INCLUDE_DIR_SUFFIXES libsoup-2.4 libsoup-2.4/include libsoup libsoup/include
+ DEPENDS GIO
+)
+
+if(Soup3_FOUND AND NOT Soup3_VERSION)
+ find_file(Soup3_VERSION_HEADER "libsoup/soup-version.h" HINTS ${Soup3_INCLUDE_DIRS})
+ mark_as_advanced(Soup3_VERSION_HEADER)
+
+ if(Soup3_VERSION_HEADER)
+ file(STRINGS "${Soup3_VERSION_HEADER}" Soup3_MAJOR_VERSION REGEX "^#define SOUP_MAJOR_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MAJOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup3_MAJOR_VERSION "${Soup3_MAJOR_VERSION}")
+ file(STRINGS "${Soup3_VERSION_HEADER}" Soup3_MINOR_VERSION REGEX "^#define SOUP_MINOR_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MINOR_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup3_MINOR_VERSION "${Soup3_MINOR_VERSION}")
+ file(STRINGS "${Soup3_VERSION_HEADER}" Soup3_MICRO_VERSION REGEX "^#define SOUP_MICRO_VERSION +\\(?([0-9]+)\\)?$")
+ string(REGEX REPLACE "^#define SOUP_MICRO_VERSION \\(?([0-9]+)\\)?$" "\\1" Soup3_MICRO_VERSION "${Soup3_MICRO_VERSION}")
+ set(Soup3_VERSION "${Soup3_MAJOR_VERSION}.${Soup3_MINOR_VERSION}.${Soup3_MICRO_VERSION}")
+ unset(Soup3_MAJOR_VERSION)
+ unset(Soup3_MINOR_VERSION)
+ unset(Soup3_MICRO_VERSION)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Soup3
+ REQUIRED_VARS Soup3_LIBRARY
+ VERSION_VAR Soup3_VERSION)