summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmake/FindCUnit.cmake40
-rw-r--r--cmake/FindLibbrotlidec.cmake36
-rw-r--r--cmake/FindLibbrotlienc.cmake36
-rw-r--r--cmake/PickyWarningsC.cmake1
-rw-r--r--cmakeconfig.h.in3
5 files changed, 75 insertions, 41 deletions
diff --git a/cmake/FindCUnit.cmake b/cmake/FindCUnit.cmake
deleted file mode 100644
index ada87c1..0000000
--- a/cmake/FindCUnit.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-# - Try to find cunit
-# Once done this will define
-# CUNIT_FOUND - System has cunit
-# CUNIT_INCLUDE_DIRS - The cunit include directories
-# CUNIT_LIBRARIES - The libraries needed to use cunit
-
-find_package(PkgConfig QUIET)
-pkg_check_modules(PC_CUNIT QUIET cunit)
-
-find_path(CUNIT_INCLUDE_DIR
- NAMES CUnit/CUnit.h
- HINTS ${PC_CUNIT_INCLUDE_DIRS}
-)
-find_library(CUNIT_LIBRARY
- NAMES cunit
- HINTS ${PC_CUNIT_LIBRARY_DIRS}
-)
-
-if(CUNIT_INCLUDE_DIR)
- set(_version_regex "^#define[ \t]+CU_VERSION[ \t]+\"([^\"]+)\".*")
- file(STRINGS "${CUNIT_INCLUDE_DIR}/CUnit/CUnit.h"
- CUNIT_VERSION REGEX "${_version_regex}")
- string(REGEX REPLACE "${_version_regex}" "\\1"
- CUNIT_VERSION "${CUNIT_VERSION}")
- unset(_version_regex)
-endif()
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set CUNIT_FOUND to TRUE
-# if all listed variables are TRUE and the requested version matches.
-find_package_handle_standard_args(CUnit REQUIRED_VARS
- CUNIT_LIBRARY CUNIT_INCLUDE_DIR
- VERSION_VAR CUNIT_VERSION)
-
-if(CUNIT_FOUND)
- set(CUNIT_LIBRARIES ${CUNIT_LIBRARY})
- set(CUNIT_INCLUDE_DIRS ${CUNIT_INCLUDE_DIR})
-endif()
-
-mark_as_advanced(CUNIT_INCLUDE_DIR CUNIT_LIBRARY)
diff --git a/cmake/FindLibbrotlidec.cmake b/cmake/FindLibbrotlidec.cmake
new file mode 100644
index 0000000..59066c6
--- /dev/null
+++ b/cmake/FindLibbrotlidec.cmake
@@ -0,0 +1,36 @@
+# - Try to find libbrotlidec
+# Once done this will define
+# LIBBROTLIDEC_FOUND - System has libbrotlidec
+# LIBBROTLIDEC_INCLUDE_DIRS - The libbrotlidec include directories
+# LIBBROTLIDEC_LIBRARIES - The libraries needed to use libbrotlidec
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_LIBBROTLIDEC QUIET libbrotlidec)
+
+find_path(LIBBROTLIDEC_INCLUDE_DIR
+ NAMES brotli/decode.h
+ HINTS ${PC_LIBBROTLIDEC_INCLUDE_DIRS}
+)
+find_library(LIBBROTLIDEC_LIBRARY
+ NAMES brotlidec
+ HINTS ${PC_LIBBROTLIDEC_LIBRARY_DIRS}
+)
+
+if(PC_LIBBROTLIDEC_FOUND)
+ set(LIBBROTLIDEC_VERSION ${PC_LIBBROTLIDEC_VERSION})
+endif()
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LIBBROTLIDEC_FOUND
+# to TRUE if all listed variables are TRUE and the requested version
+# matches.
+find_package_handle_standard_args(Libbrotlidec REQUIRED_VARS
+ LIBBROTLIDEC_LIBRARY LIBBROTLIDEC_INCLUDE_DIR
+ VERSION_VAR LIBBROTLIDEC_VERSION)
+
+if(LIBBROTLIDEC_FOUND)
+ set(LIBBROTLIDEC_LIBRARIES ${LIBBROTLIDEC_LIBRARY})
+ set(LIBBROTLIDEC_INCLUDE_DIRS ${LIBBROTLIDEC_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(LIBBROTLIDEC_INCLUDE_DIR LIBBROTLIDEC_LIBRARY)
diff --git a/cmake/FindLibbrotlienc.cmake b/cmake/FindLibbrotlienc.cmake
new file mode 100644
index 0000000..acf6334
--- /dev/null
+++ b/cmake/FindLibbrotlienc.cmake
@@ -0,0 +1,36 @@
+# - Try to find libbrotlienc
+# Once done this will define
+# LIBBROTLIENC_FOUND - System has libbrotlienc
+# LIBBROTLIENC_INCLUDE_DIRS - The libbrotlienc include directories
+# LIBBROTLIENC_LIBRARIES - The libraries needed to use libbrotlienc
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_LIBBROTLIENC QUIET libbrotlienc)
+
+find_path(LIBBROTLIENC_INCLUDE_DIR
+ NAMES brotli/encode.h
+ HINTS ${PC_LIBBROTLIENC_INCLUDE_DIRS}
+)
+find_library(LIBBROTLIENC_LIBRARY
+ NAMES brotlienc
+ HINTS ${PC_LIBBROTLIENC_LIBRARY_DIRS}
+)
+
+if(PC_LIBBROTLIENC_FOUND)
+ set(LIBBROTLIENC_VERSION ${PC_LIBBROTLIENC_VERSION})
+endif()
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LIBBROTLIENC_FOUND
+# to TRUE if all listed variables are TRUE and the requested version
+# matches.
+find_package_handle_standard_args(Libbrotlienc REQUIRED_VARS
+ LIBBROTLIENC_LIBRARY LIBBROTLIENC_INCLUDE_DIR
+ VERSION_VAR LIBBROTLIENC_VERSION)
+
+if(LIBBROTLIENC_FOUND)
+ set(LIBBROTLIENC_LIBRARIES ${LIBBROTLIENC_LIBRARY})
+ set(LIBBROTLIENC_INCLUDE_DIRS ${LIBBROTLIENC_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(LIBBROTLIENC_INCLUDE_DIR LIBBROTLIENC_LIBRARY)
diff --git a/cmake/PickyWarningsC.cmake b/cmake/PickyWarningsC.cmake
index 50eb789..6a5ee27 100644
--- a/cmake/PickyWarningsC.cmake
+++ b/cmake/PickyWarningsC.cmake
@@ -85,7 +85,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MA
-Wstrict-prototypes # clang 1.0 gcc 3.3
# -Wswitch-enum # clang 3.0 gcc 4.1 # Not used because this basically disallows default case
-Wunreachable-code # clang 3.0 gcc 4.1
- -Wunused-macros # clang 3.0 gcc 4.1
-Wunused-parameter # clang 3.0 gcc 4.1
-Wvla # clang 2.8 gcc 4.3
)
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index a011d00..20916ca 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -99,3 +99,6 @@
/* Define to 1 if you have `libev` library. */
#cmakedefine HAVE_LIBEV 1
+
+/* Define to 1 if you have `libbrotlienc` and `libbrotlidec` libraries. */
+#cmakedefine HAVE_LIBBROTLI 1