This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/cmake/modules/FindGnuRegex.cmake
2013-03-25 21:10:14 +07:00

23 lines
849 B
CMake

# - Find GnuRegex
# Find the native GnuRegex includes and library
#
# GNUREGEX_INCLUDE_DIR - where to find regex.h
# GNUREGEX_LIBRARIES - List of libraries when using GnuRegex.
# GNUREGEX_FOUND - True if GnuRegex found.
find_path (GNUREGEX_INCLUDE_DIR regex.h)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Windows, library needed
find_library(GNUREGEX_LIBRARIES NAMES regex gnurx)
else(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# library not needed
set(GNUREGEX_LIBRARIES TRUE)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# handle the QUIETLY and REQUIRED arguments and set GNUREGEX_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (GnuRegex DEFAULT_MSG GNUREGEX_LIBRARIES GNUREGEX_INCLUDE_DIR)
mark_as_advanced (GNUREGEX_LIBRARIES GNUREGEX_INCLUDE_DIR)