Move custom Find modules to their own folder

This commit is contained in:
James Rowe
2020-04-20 00:42:42 -06:00
committed by James Rowe
parent 1374e51a47
commit 153dbb8132
10 changed files with 352 additions and 0 deletions

35
externals/find-modules/FindCatch2.cmake vendored Normal file
View File

@@ -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
)

41
externals/find-modules/FindIconv.cmake vendored Normal file
View File

@@ -0,0 +1,41 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_iconv QUIET iconv)
find_path(iconv_INCLUDE_DIR
NAMES iconv.h
PATHS ${PC_iconv_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS_LIBICONV}
)
find_library(iconv_LIBRARY
NAMES iconv
PATHS ${PC_iconv_LIBRARY_DIRS} ${CONAN_LIB_DIRS_LIBICONV}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(iconv
FOUND_VAR iconv_FOUND
REQUIRED_VARS
iconv_LIBRARY
iconv_INCLUDE_DIR
VERSION_VAR iconv_VERSION
)
if(iconv_FOUND)
set(iconv_LIBRARIES ${iconv_LIBRARY})
set(iconv_INCLUDE_DIRS ${iconv_INCLUDE_DIR})
set(iconv_DEFINITIONS ${PC_iconv_CFLAGS_OTHER})
endif()
if(iconv_FOUND AND NOT TARGET iconv::iconv)
add_library(iconv::iconv UNKNOWN IMPORTED)
set_target_properties(iconv::iconv PROPERTIES
IMPORTED_LOCATION "${iconv_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_iconv_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${iconv_INCLUDE_DIR}"
)
endif()
mark_as_advanced(
iconv_INCLUDE_DIR
iconv_LIBRARY
)

41
externals/find-modules/FindLIBZIP.cmake vendored Normal file
View File

@@ -0,0 +1,41 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_libzip QUIET libzip)
find_path(libzip_INCLUDE_DIR
NAMES zip.h
PATHS ${PC_libzip_INCLUDE_DIRS}
)
find_library(libzip_LIBRARY
NAMES libzip
PATHS ${PC_libzip_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libzip
FOUND_VAR libzip_FOUND
REQUIRED_VARS
libzip_LIBRARY
libzip_INCLUDE_DIR
VERSION_VAR libzip_VERSION
)
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
)

42
externals/find-modules/FindOpus.cmake vendored Normal file
View File

@@ -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
)

41
externals/find-modules/FindZSTD.cmake vendored Normal file
View File

@@ -0,0 +1,41 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_zstd QUIET zstd)
find_path(zstd_INCLUDE_DIR
NAMES zstd.h
PATHS ${PC_zstd_INCLUDE_DIRS}
)
find_library(zstd_LIBRARY
NAMES zstd_static
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
)

43
externals/find-modules/Findfmt.cmake vendored Normal file
View File

@@ -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
)

33
externals/find-modules/Findgetopt.cmake vendored Normal file
View File

@@ -0,0 +1,33 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_getopt QUIET getopt)
find_path(getopt_INCLUDE_DIR
NAMES getopt.h
PATHS ${PC_getopt_INCLUDE_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(getopt
FOUND_VAR getopt_FOUND
REQUIRED_VARS
getopt_INCLUDE_DIR
VERSION_VAR getopt_VERSION
)
if(getopt_FOUND)
set(getopt_INCLUDE_DIRS ${getopt_INCLUDE_DIR})
set(getopt_DEFINITIONS ${PC_getopt_CFLAGS_OTHER})
endif()
if(getopt_FOUND AND NOT TARGET getopt::getopt)
add_library(getopt::getopt UNKNOWN IMPORTED)
set_target_properties(getopt::getopt PROPERTIES
INTERFACE_COMPILE_OPTIONS "${PC_getopt_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${getopt_INCLUDE_DIR}"
)
endif()
mark_as_advanced(
getopt_INCLUDE_DIR
)

41
externals/find-modules/Findlz4.cmake vendored Normal file
View File

@@ -0,0 +1,41 @@
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}
)
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
)

View File

@@ -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
)