diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-30 17:47:12 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-30 17:47:12 -0700 |
commit | 52a77cc997e5c91fe2ed9244bfcfd9e379226091 (patch) | |
tree | 41ddbb69c68c5c52a9f12016c2c0562b545dc5cb /other/bootstrap_serverdaemon | |
parent | 1b4eea2186580bb77c2ad2a13d4263757c192c43 (diff) | |
parent | b1ec17a357f5e748ad9535079707707139a3019a (diff) |
Merge pull request #187 from Teknocrat/master
libconfig dependency
Diffstat (limited to 'other/bootstrap_serverdaemon')
-rw-r--r-- | other/bootstrap_serverdaemon/CMakeLists.txt | 3 | ||||
-rw-r--r-- | other/bootstrap_serverdaemon/cmake/Modules/FindLibConfig.cmake | 73 |
2 files changed, 76 insertions, 0 deletions
diff --git a/other/bootstrap_serverdaemon/CMakeLists.txt b/other/bootstrap_serverdaemon/CMakeLists.txt index 57ba4841..f675396d 100644 --- a/other/bootstrap_serverdaemon/CMakeLists.txt +++ b/other/bootstrap_serverdaemon/CMakeLists.txt | |||
@@ -10,3 +10,6 @@ target_link_libraries(${exe_name} | |||
10 | config) | 10 | config) |
11 | 11 | ||
12 | linkCoreLibraries(${exe_name}) | 12 | linkCoreLibraries(${exe_name}) |
13 | |||
14 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") | ||
15 | find_package(LibConfig REQUIRED) | ||
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 | |||
14 | FIND_PATH(LIBCONFIG_INCLUDE_DIR libconfig.h | ||
15 | /usr/local/include | ||
16 | /usr/include | ||
17 | ) | ||
18 | |||
19 | FIND_PATH(LIBCONFIGPP_INCLUDE_DIR libconfig.h++ | ||
20 | /usr/local/include | ||
21 | /usr/include | ||
22 | ) | ||
23 | |||
24 | FIND_LIBRARY(LIBCONFIG_LIBRARY config | ||
25 | /usr/local/lib | ||
26 | /usr/lib | ||
27 | ) | ||
28 | |||
29 | FIND_LIBRARY(LIBCONFIGPP_LIBRARY config++ | ||
30 | /usr/local/lib | ||
31 | /usr/lib | ||
32 | ) | ||
33 | |||
34 | FIND_LIBRARY(LIBCONFIG_STATIC_LIBRARY "libconfig${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
35 | /usr/local/lib | ||
36 | /usr/lib | ||
37 | ) | ||
38 | |||
39 | FIND_LIBRARY(LIBCONFIGPP_STATIC_LIBRARY "libconfig++${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
40 | /usr/local/lib | ||
41 | /usr/lib | ||
42 | ) | ||
43 | |||
44 | |||
45 | IF(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) | ||
51 | ENDIF(LIBCONFIG_INCLUDE_DIR) | ||
52 | |||
53 | IF(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) | ||
59 | ENDIF(LIBCONFIGPP_INCLUDE_DIR) | ||
60 | |||
61 | IF (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) | ||
67 | ELSE (LIBCONFIG_FOUND) | ||
68 | IF (LibConfig_FIND_REQUIRED) | ||
69 | MESSAGE(SEND_ERROR "Could NOT find LibConfig") | ||
70 | ENDIF (LibConfig_FIND_REQUIRED) | ||
71 | ENDIF (LIBCONFIG_FOUND) | ||
72 | |||
73 | MARK_AS_ADVANCED(LIBCONFIG_INCLUDE_DIR LIBCONFIG_LIBRARIES) | ||