summaryrefslogtreecommitdiff
path: root/cmake/FindPoly.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindPoly.cmake')
-rw-r--r--cmake/FindPoly.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/FindPoly.cmake b/cmake/FindPoly.cmake
new file mode 100644
index 000000000..5f4383732
--- /dev/null
+++ b/cmake/FindPoly.cmake
@@ -0,0 +1,24 @@
+# Find LibPoly
+# POLY_FOUND - system has LibPoly
+# POLY_INCLUDE_DIR - the LibPoly include directory
+# POLY_LIBRARIES - Libraries needed to use LibPoly
+
+# Note: contrib/get-poly copies header files to deps/install/include/poly.
+# However, includes in LibPoly headers are not prefixed with "poly/" and therefore
+# we have to look for headers in include/poly instead of include/.
+find_path(POLY_INCLUDE_DIR NAMES poly/poly.h PATH_SUFFIXES poly)
+find_library(POLY_LIB NAMES poly)
+find_library(POLY_LIBXX NAMES polyxx)
+set(POLY_LIBRARIES "${POLY_LIBXX};${POLY_LIB}")
+unset(POLY_LIB CACHE)
+unset(POLY_LIBXX CACHE)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Poly
+ DEFAULT_MSG
+ POLY_INCLUDE_DIR POLY_LIBRARIES)
+
+mark_as_advanced(POLY_INCLUDE_DIR POLY_LIBRARIES)
+if(POLY_LIBRARIES)
+ message(STATUS "Found LibPoly: ${POLY_LIBRARIES}")
+endif()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback