summaryrefslogtreecommitdiff
path: root/other/bootstrap_serverdaemon/cmake/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'other/bootstrap_serverdaemon/cmake/Modules')
-rw-r--r--other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake73
1 files changed, 73 insertions, 0 deletions
diff --git a/other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake b/other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake
new file mode 100644
index 00000000..7d6270e6
--- /dev/null
+++ b/other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake
@@ -0,0 +1,73 @@
1#Ref: https://github.com/schnorr/pajeng/blob/master/cmake/FindLibConfig.cmake
2#
3# This module defines
4# LIBCONFIG_INCLUDE_DIR, where to find cppunit include files, etc.
5# LIBCONFIG_LIBRARIES, the libraries to link against to use CppUnit.
6# LIBCONFIG_STATIC_LIBRARIY_PATH
7# LIBCONFIG_FOUND, If false, do not try to use CppUnit.
8
9# also defined, but not for general use are
10# LIBCONFIG_LIBRARY, where to find the CUnit library.
11
12#MESSAGE("Searching for libconfig library")
13
14FIND_PATH(LIBCONFIG_INCLUDE_DIR libconfig.h
15 /usr/local/include
16 /usr/include
17)
18
19FIND_PATH(LIBCONFIGPP_INCLUDE_DIR libconfig.h++
20 /usr/local/include
21 /usr/include
22)
23
24FIND_LIBRARY(LIBCONFIG_LIBRARY config
25 /usr/local/lib
26 /usr/lib
27)
28
29FIND_LIBRARY(LIBCONFIGPP_LIBRARY config++
30 /usr/local/lib
31 /usr/lib
32)
33
34FIND_LIBRARY(LIBCONFIG_STATIC_LIBRARY "libconfig${CMAKE_STATIC_LIBRARY_SUFFIX}"
35 /usr/local/lib
36 /usr/lib
37)
38
39FIND_LIBRARY(LIBCONFIGPP_STATIC_LIBRARY "libconfig++${CMAKE_STATIC_LIBRARY_SUFFIX}"
40 /usr/local/lib
41 /usr/lib
42)
43
44
45IF(LIBCONFIG_INCLUDE_DIR)
46 IF(LIBCONFIG_LIBRARY)
47 SET(LIBCONFIG_FOUND TRUE)
48 SET(LIBCONFIG_LIBRARIES ${LIBCONFIG_LIBRARY})
49 SET(LIBCONFIG_STATIC_LIBRARY_PATH ${LIBCONFIG_STATIC_LIBRARY})
50 ENDIF(LIBCONFIG_LIBRARY)
51ENDIF(LIBCONFIG_INCLUDE_DIR)
52
53IF(LIBCONFIGPP_INCLUDE_DIR)
54 IF(LIBCONFIGPP_LIBRARY)
55 SET(LIBCONFIGPP_FOUND TRUE)
56 SET(LIBCONFIGPP_LIBRARIES ${LIBCONFIGPP_LIBRARY})
57 SET(LIBCONFIGPP_STATIC_LIBRARY_PATH ${LIBCONFIGPP_STATIC_LIBRARY})
58 ENDIF(LIBCONFIGPP_LIBRARY)
59ENDIF(LIBCONFIGPP_INCLUDE_DIR)
60
61IF (LIBCONFIG_FOUND)
62 IF (NOT LibConfig_FIND_QUIETLY)
63 MESSAGE(STATUS "Found LibConfig++: ${LIBCONFIGPP_LIBRARIES}" )
64 MESSAGE(STATUS "Found LibConfig: ${LIBCONFIG_LIBRARIES}")
65 MESSAGE(STATUS "static LibConfig path: ${LIBCONFIG_STATIC_LIBRARY_PATH}")
66 ENDIF (NOT LibConfig_FIND_QUIETLY)
67ELSE (LIBCONFIG_FOUND)
68 IF (LibConfig_FIND_REQUIRED)
69 MESSAGE(SEND_ERROR "Could NOT find LibConfig")
70 ENDIF (LibConfig_FIND_REQUIRED)
71ENDIF (LIBCONFIG_FOUND)
72
73MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARIES)