summaryrefslogtreecommitdiff
path: root/cmake/FindLFSC.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindLFSC.cmake')
-rw-r--r--cmake/FindLFSC.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/FindLFSC.cmake b/cmake/FindLFSC.cmake
new file mode 100644
index 000000000..7a666839b
--- /dev/null
+++ b/cmake/FindLFSC.cmake
@@ -0,0 +1,37 @@
+# Find LFSC
+# LFSC_FOUND - system has LFSC lib
+# LFSC_INCLUDE_DIR - the LFSC include directory
+# LFSC_LIBRARIES - Libraries needed to use LFSC
+
+
+# Check default location of LFSC built with contrib/get-lfsc.
+# If the user provides a directory we will not search the default paths and
+# fail if LFSC was not found in the specified directory.
+if(NOT LFSC_HOME)
+ set(LFSC_HOME ${PROJECT_SOURCE_DIR}/lfsc-checker/install)
+ set(CHECK_SYSTEM_VERSION TRUE)
+endif()
+
+find_path(LFSC_INCLUDE_DIR
+ NAMES lfscc.h
+ PATHS ${LFSC_HOME}/include
+ NO_DEFAULT_PATH)
+find_library(LFSC_LIBRARIES
+ NAMES lfscc
+ PATHS ${LFSC_HOME}/lib
+ NO_DEFAULT_PATH)
+
+if(CHECK_SYSTEM_VERSION)
+ find_path(LFSC_INCLUDE_DIR NAMES lfscc.h)
+ find_library(LFSC_LIBRARIES NAMES lfscc)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LFSC
+ DEFAULT_MSG
+ LFSC_INCLUDE_DIR LFSC_LIBRARIES)
+
+mark_as_advanced(LFSC_INCLUDE_DIR LFSC_LIBRARIES)
+if(LFSC_LIBRARIES)
+ message(STATUS "Found LFSC libs: ${LFSC_LIBRARIES}")
+endif()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback