summaryrefslogtreecommitdiff
path: root/cmake/FindLFSC.cmake
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-08-29 08:20:31 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2018-09-22 16:30:59 -0700
commit8f311f52037a9fb6a82d062342fec4b5396173c6 (patch)
treed20966972af4872d7b30dca1de41c1fc55f2decf /cmake/FindLFSC.cmake
parent7be6be7dec00579cb7eaae32bed1217d6c35ee83 (diff)
cmake: Add options for specifying install directories for dependencies.
Diffstat (limited to 'cmake/FindLFSC.cmake')
-rw-r--r--cmake/FindLFSC.cmake20
1 files changed, 18 insertions, 2 deletions
diff --git a/cmake/FindLFSC.cmake b/cmake/FindLFSC.cmake
index 7176b2015..2e3118669 100644
--- a/cmake/FindLFSC.cmake
+++ b/cmake/FindLFSC.cmake
@@ -3,12 +3,28 @@
# 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 "${PROJECT_SOURCE_DIR}/lfsc-checker/install/include")
+ PATHS ${LFSC_HOME}/include
+ NO_DEFAULT_PATH)
find_library(LFSC_LIBRARIES
NAMES lfscc
- PATHS "${PROJECT_SOURCE_DIR}/lfsc-checker/install/lib")
+ 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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback