summaryrefslogtreecommitdiffstats
path: root/externals/find-modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--externals/find-modules/FindCatch2.cmake35
-rw-r--r--externals/find-modules/FindLibzip.cmake69
-rw-r--r--externals/find-modules/FindUnicorn.cmake (renamed from externals/cmake-modules/FindUnicorn.cmake)0
-rw-r--r--externals/find-modules/Findfmt.cmake43
-rw-r--r--externals/find-modules/Findlz4.cmake54
-rw-r--r--externals/find-modules/Findnlohmann_json.cmake35
-rw-r--r--externals/find-modules/Findopus.cmake42
-rw-r--r--externals/find-modules/Findzstd.cmake41
8 files changed, 319 insertions, 0 deletions
diff --git a/externals/find-modules/FindCatch2.cmake b/externals/find-modules/FindCatch2.cmake
new file mode 100644
index 000000000..a83c668bf
--- /dev/null
+++ b/externals/find-modules/FindCatch2.cmake
@@ -0,0 +1,35 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_Catch2 QUIET Catch2)
+
+find_path(Catch2_INCLUDE_DIR
+ NAMES catch.hpp
+ PATHS ${PC_Catch2_INCLUDE_DIRS} ${CONAN_CATCH2_ROOT}
+ PATH_SUFFIXES catch2
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Catch2
+ FOUND_VAR Catch2_FOUND
+ REQUIRED_VARS
+ Catch2_INCLUDE_DIR
+ VERSION_VAR Catch2_VERSION
+)
+
+if(Catch2_FOUND)
+ set(Catch2_INCLUDE_DIRS ${Catch2_INCLUDE_DIR})
+ set(Catch2_DEFINITIONS ${PC_Catch2_CFLAGS_OTHER})
+endif()
+
+if(Catch2_FOUND AND NOT TARGET Catch2::Catch2)
+ add_library(Catch2::Catch2 UNKNOWN IMPORTED)
+ set_target_properties(Catch2::Catch2 PROPERTIES
+ IMPORTED_LOCATION "${Catch2_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_Catch2_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Catch2_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ Catch2_INCLUDE_DIR
+)
diff --git a/externals/find-modules/FindLibzip.cmake b/externals/find-modules/FindLibzip.cmake
new file mode 100644
index 000000000..0b5148856
--- /dev/null
+++ b/externals/find-modules/FindLibzip.cmake
@@ -0,0 +1,69 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_LIBZIP QUIET libzip)
+
+find_path(LIBZIP_INCLUDE_DIR
+ NAMES zip.h
+ PATHS ${PC_LIBZIP_INCLUDE_DIRS}
+ "$ENV{LIB_DIR}/include"
+ "$ENV{INCLUDE}"
+ /usr/local/include
+ /usr/include
+)
+find_path(LIBZIP_INCLUDE_DIR_ZIPCONF
+ NAMES zipconf.h
+ HINTS ${PC_LIBZIP_INCLUDE_DIRS}
+ "$ENV{LIB_DIR}/include"
+ "$ENV{LIB_DIR}/lib/libzip/include"
+ "$ENV{LIB}/lib/libzip/include"
+ /usr/local/lib/libzip/include
+ /usr/lib/libzip/include
+ /usr/local/include
+ /usr/include
+ "$ENV{INCLUDE}"
+)
+find_library(LIBZIP_LIBRARY
+ NAMES zip
+ PATHS ${PC_LIBZIP_LIBRARY_DIRS}
+ "$ENV{LIB_DIR}/lib" "$ENV{LIB}" /usr/local/lib /usr/lib
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Libzip
+ FOUND_VAR LIBZIP_FOUND
+ REQUIRED_VARS
+ LIBZIP_LIBRARY
+ LIBZIP_INCLUDE_DIR
+ LIBZIP_INCLUDE_DIR_ZIPCONF
+)
+
+set(LIBZIP_VERSION 0)
+
+if (LIBZIP_INCLUDE_DIR_ZIPCONF)
+ FILE(READ "${LIBZIP_INCLUDE_DIR_ZIPCONF}/zipconf.h" _LIBZIP_VERSION_CONTENTS)
+ if (_LIBZIP_VERSION_CONTENTS)
+ STRING(REGEX REPLACE ".*#define LIBZIP_VERSION \"([0-9.]+)\".*" "\\1" LIBZIP_VERSION "${_LIBZIP_VERSION_CONTENTS}")
+ endif()
+endif()
+
+set(LIBZIP_VERSION ${LIBZIP_VERSION} CACHE STRING "Version number of libzip")
+
+if(LIBZIP_FOUND)
+ set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY})
+ set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})
+ set(LIBZIP_DEFINITIONS ${PC_LIBZIP_CFLAGS_OTHER})
+endif()
+
+if(LIBZIP_FOUND AND NOT TARGET libzip::libzip)
+ add_library(libzip::libzip UNKNOWN IMPORTED)
+ set_target_properties(libzip::libzip PROPERTIES
+ IMPORTED_LOCATION "${LIBZIP_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_LIBZIP_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBZIP_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ LIBZIP_INCLUDE_DIR
+ LIBZIP_LIBRARY
+)
diff --git a/externals/cmake-modules/FindUnicorn.cmake b/externals/find-modules/FindUnicorn.cmake
index a0f2a71f6..a0f2a71f6 100644
--- a/externals/cmake-modules/FindUnicorn.cmake
+++ b/externals/find-modules/FindUnicorn.cmake
diff --git a/externals/find-modules/Findfmt.cmake b/externals/find-modules/Findfmt.cmake
new file mode 100644
index 000000000..e0a04a344
--- /dev/null
+++ b/externals/find-modules/Findfmt.cmake
@@ -0,0 +1,43 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_fmt QUIET fmt)
+
+find_path(fmt_INCLUDE_DIR
+ NAMES format.h
+ PATHS ${PC_fmt_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS_fmt}
+ PATH_SUFFIXES fmt
+)
+
+find_library(fmt_LIBRARY
+ NAMES fmt
+ PATHS ${PC_fmt_LIBRARY_DIRS} ${CONAN_LIB_DIRS_fmt}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(fmt
+ FOUND_VAR fmt_FOUND
+ REQUIRED_VARS
+ fmt_LIBRARY
+ fmt_INCLUDE_DIR
+ VERSION_VAR fmt_VERSION
+)
+
+if(fmt_FOUND)
+ set(fmt_LIBRARIES ${fmt_LIBRARY})
+ set(fmt_INCLUDE_DIRS ${fmt_INCLUDE_DIR})
+ set(fmt_DEFINITIONS ${PC_fmt_CFLAGS_OTHER})
+endif()
+
+if(fmt_FOUND AND NOT TARGET fmt::fmt)
+ add_library(fmt::fmt UNKNOWN IMPORTED)
+ set_target_properties(fmt::fmt PROPERTIES
+ IMPORTED_LOCATION "${fmt_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_fmt_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${fmt_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ fmt_INCLUDE_DIR
+ fmt_LIBRARY
+)
diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake
new file mode 100644
index 000000000..6279854c0
--- /dev/null
+++ b/externals/find-modules/Findlz4.cmake
@@ -0,0 +1,54 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_lz4 QUIET lz4)
+
+find_path(lz4_INCLUDE_DIR
+ NAMES lz4.h
+ PATHS ${PC_lz4_INCLUDE_DIRS}
+)
+find_library(lz4_LIBRARY
+ NAMES lz4
+ PATHS ${PC_lz4_LIBRARY_DIRS}
+)
+
+if(lz4_INCLUDE_DIR)
+ file(STRINGS "${lz4_INCLUDE_DIR}/lz4.h" _lz4_version_lines
+ REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)")
+ string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}")
+ string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}")
+ string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}")
+ set(lz4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}")
+ unset(_lz4_version_major)
+ unset(_lz4_version_minor)
+ unset(_lz4_version_release)
+ unset(_lz4_version_lines)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(lz4
+ FOUND_VAR lz4_FOUND
+ REQUIRED_VARS
+ lz4_LIBRARY
+ lz4_INCLUDE_DIR
+ VERSION_VAR lz4_VERSION
+)
+
+if(lz4_FOUND)
+ set(lz4_LIBRARIES ${lz4_LIBRARY})
+ set(lz4_INCLUDE_DIRS ${lz4_INCLUDE_DIR})
+ set(lz4_DEFINITIONS ${PC_lz4_CFLAGS_OTHER})
+endif()
+
+if(lz4_FOUND AND NOT TARGET lz4::lz4)
+ add_library(lz4::lz4 UNKNOWN IMPORTED)
+ set_target_properties(lz4::lz4 PROPERTIES
+ IMPORTED_LOCATION "${lz4_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_lz4_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${lz4_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ lz4_INCLUDE_DIR
+ lz4_LIBRARY
+)
diff --git a/externals/find-modules/Findnlohmann_json.cmake b/externals/find-modules/Findnlohmann_json.cmake
new file mode 100644
index 000000000..a3bf1d774
--- /dev/null
+++ b/externals/find-modules/Findnlohmann_json.cmake
@@ -0,0 +1,35 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_nlohmann_json QUIET nlohmann_json)
+
+find_path(nlohmann_json_INCLUDE_DIR
+ NAMES json.hpp
+ PATHS ${PC_nlohmann_json_INCLUDE_DIRS}
+ PATH_SUFFIXES nlohmann
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(nlohmann_json
+ FOUND_VAR nlohmann_json_FOUND
+ REQUIRED_VARS
+ nlohmann_json_INCLUDE_DIR
+ VERSION_VAR nlohmann_json_VERSION
+)
+
+if(nlohmann_json_FOUND)
+ set(nlohmann_json_INCLUDE_DIRS ${nlohmann_json_INCLUDE_DIR})
+ set(nlohmann_json_DEFINITIONS ${PC_nlohmann_json_CFLAGS_OTHER})
+endif()
+
+if(nlohmann_json_FOUND AND NOT TARGET nlohmann_json::nlohmann_json)
+ add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED)
+ set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
+ IMPORTED_LOCATION "${nlohmann_json_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_nlohmann_json_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ nlohmann_json_INCLUDE_DIR
+)
diff --git a/externals/find-modules/Findopus.cmake b/externals/find-modules/Findopus.cmake
new file mode 100644
index 000000000..de84bd995
--- /dev/null
+++ b/externals/find-modules/Findopus.cmake
@@ -0,0 +1,42 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_opus QUIET opus)
+
+find_path(opus_INCLUDE_DIR
+ NAMES opus.h
+ PATHS ${PC_opus_INCLUDE_DIRS}
+ PATH_SUFFIXES opus
+)
+find_library(opus_LIBRARY
+ NAMES opus
+ PATHS ${PC_opus_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(opus
+ FOUND_VAR opus_FOUND
+ REQUIRED_VARS
+ opus_LIBRARY
+ opus_INCLUDE_DIR
+ VERSION_VAR opus_VERSION
+)
+
+if(opus_FOUND)
+ set(Opus_LIBRARIES ${opus_LIBRARY})
+ set(Opus_INCLUDE_DIRS ${opus_INCLUDE_DIR})
+ set(Opus_DEFINITIONS ${PC_opus_CFLAGS_OTHER})
+endif()
+
+if(opus_FOUND AND NOT TARGET Opus::Opus)
+ add_library(Opus::Opus UNKNOWN IMPORTED)
+ set_target_properties(Opus::Opus PROPERTIES
+ IMPORTED_LOCATION "${opus_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_opus_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${opus_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ opus_INCLUDE_DIR
+ opus_LIBRARY
+)
diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake
new file mode 100644
index 000000000..cd0158b0c
--- /dev/null
+++ b/externals/find-modules/Findzstd.cmake
@@ -0,0 +1,41 @@
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_zstd QUIET libzstd)
+
+find_path(zstd_INCLUDE_DIR
+ NAMES zstd.h
+ PATHS ${PC_zstd_INCLUDE_DIRS}
+)
+find_library(zstd_LIBRARY
+ NAMES zstd
+ PATHS ${PC_zstd_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(zstd
+ FOUND_VAR zstd_FOUND
+ REQUIRED_VARS
+ zstd_LIBRARY
+ zstd_INCLUDE_DIR
+ VERSION_VAR zstd_VERSION
+)
+
+if(zstd_FOUND)
+ set(zstd_LIBRARIES ${zstd_LIBRARY})
+ set(zstd_INCLUDE_DIRS ${zstd_INCLUDE_DIR})
+ set(zstd_DEFINITIONS ${PC_zstd_CFLAGS_OTHER})
+endif()
+
+if(zstd_FOUND AND NOT TARGET zstd::zstd)
+ add_library(zstd::zstd UNKNOWN IMPORTED)
+ set_target_properties(zstd::zstd PROPERTIES
+ IMPORTED_LOCATION "${zstd_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ zstd_INCLUDE_DIR
+ zstd_LIBRARY
+)