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

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
)