summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindConfig.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/FindConfig.cmake')
-rw-r--r--cmake/Modules/FindConfig.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/Modules/FindConfig.cmake b/cmake/Modules/FindConfig.cmake
new file mode 100644
index 000000000..5361d9611
--- /dev/null
+++ b/cmake/Modules/FindConfig.cmake
@@ -0,0 +1,23 @@
+FIND_PATH(CONFIG_INCLUDE_DIR libconfig.h /usr/include /usr/local/include)
+
+FIND_LIBRARY(CONFIG_LIBRARY NAMES config PATH /usr/lib /usr/local/lib)
+
+IF (CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY)
+ SET(CONFIG_FOUND TRUE)
+ENDIF ( CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY)
+
+IF (CONFIG_FOUND)
+ IF (NOT CONFIG_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Config: ${CONFIG_LIBRARY}")
+ ENDIF (NOT CONFIG_FIND_QUIETLY)
+ELSE(CONFIG_FOUND)
+ IF (Config_FIND_REQUIRED)
+ IF(NOT CONFIG_INCLUDE_DIR)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig header file!")
+ ENDIF(NOT CONFIG_INCLUDE_DIR)
+
+ IF(NOT CONFIG_LIBRARY)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig library file!")
+ ENDIF(NOT CONFIG_LIBRARY)
+ ENDIF (Config_FIND_REQUIRED)
+ENDIF (CONFIG_FOUND) \ No newline at end of file