diff options
Diffstat (limited to 'trunk/cmake')
-rw-r--r-- | trunk/cmake/Modules/FindGnunet.cmake | 93 | ||||
-rw-r--r-- | trunk/cmake/Modules/FindSIGC++.cmake | 43 | ||||
-rw-r--r-- | trunk/cmake/Modules/FindSigC++.cmake | 92 |
3 files changed, 228 insertions, 0 deletions
diff --git a/trunk/cmake/Modules/FindGnunet.cmake b/trunk/cmake/Modules/FindGnunet.cmake new file mode 100644 index 0000000..87cff9f --- /dev/null +++ b/trunk/cmake/Modules/FindGnunet.cmake | |||
@@ -0,0 +1,93 @@ | |||
1 | # FindGnunet.cmake | ||
2 | # | ||
3 | # author: lurchi | ||
4 | # date: 2016-01-31 | ||
5 | # version: 0.1 | ||
6 | # | ||
7 | # Result variables: | ||
8 | # - GNUNET_FOUND: | ||
9 | # true if gnunet is found | ||
10 | # - GNUNET_INCLUDE_DIRS: | ||
11 | # the needed gnunet include directories | ||
12 | # - GNUNET_LIBRARIES: | ||
13 | # the needed gnunet libraries | ||
14 | # | ||
15 | # set GNUNET_SOCIAL_NEEDED before find_package(Gnunet) call if the social API is needed | ||
16 | |||
17 | include(CheckLibraryExists) | ||
18 | include(FindPackageHandleStandardArgs) | ||
19 | |||
20 | set(GNUNET_LIBRARIES_OK true) | ||
21 | set(GNUNET_SOCIAL_LIBRARIES_OK true) | ||
22 | set(GNUNET_INCLUDE_DIRS_OK true) | ||
23 | set(GNUNET_SOCIAL_INCLUDE_DIRS_OK true) | ||
24 | |||
25 | # gnunet libraries | ||
26 | find_library(GNUNET_CORE_LIB NAMES gnunetcore) | ||
27 | find_library(GNUNET_UTIL_LIB NAMES gnunetutil) | ||
28 | find_library(GNUNET_IDENTITY_LIB NAMES gnunetidentity) | ||
29 | find_library(GNUNET_ARM_LIB NAMES gnunetarm) | ||
30 | find_library(GNUNET_FRIENDS_LIB NAMES gnunetfriends) | ||
31 | |||
32 | file(GLOB GNUNET_LIBRARIES ${GNUNET_CORE_LIB} | ||
33 | ${GNUNET_UTIL_LIB} | ||
34 | ${GNUNET_IDENTITY_LIB} | ||
35 | ${GNUNET_ARM_LIB} | ||
36 | ${GNUNET_FRIENDS_LIB}) | ||
37 | |||
38 | if(NOT (GNUNET_CORE_LIB AND | ||
39 | GNUNET_UTIL_LIB AND | ||
40 | GNUNET_IDENTITY_LIB AND | ||
41 | GNUNET_ARM_LIB AND | ||
42 | GNUNET_FRIENDS_LIB)) | ||
43 | set(GNUNET_LIBRARIES_OK false) | ||
44 | endif() | ||
45 | |||
46 | # gnunet include dirs | ||
47 | find_path(GNUNET_PLATFORM_H NAMES gnunet/platform.h) | ||
48 | find_path(GNUNET_UTIL_LIB_H NAMES gnunet/gnunet_util_lib.h) | ||
49 | |||
50 | file(GLOB GNUNET_INCLUDE_DIRS ${GNUNET_PLATFORM_H} | ||
51 | ${GNUNET_UTIL_LIB_H}) | ||
52 | |||
53 | if(NOT (GNUNET_PLATFORM_H AND | ||
54 | GNUNET_UTIL_LIB_H)) | ||
55 | set(GNUNET_INCLUDE_DIRS_OK false) | ||
56 | endif() | ||
57 | |||
58 | # gnunet social API | ||
59 | if(GNUNET_SOCIAL_NEEDED) | ||
60 | # gnunet social API libraries | ||
61 | find_library(GNUNET_PSYC_UTIL NAMES gnunetpsycutil) | ||
62 | find_library(GNUNET_SOCIAL NAMES gnunetsocial) | ||
63 | |||
64 | file(GLOB GNUNET_SOCIAL_LIBRARIES ${GNUNET_PSYC_UTIL} | ||
65 | ${GNUNET_SOCIAL}) | ||
66 | set(GNUNET_LIBRARIES ${GNUNET_LIBRARIES} ${GNUNET_SOCIAL_LIBRARIES}) | ||
67 | |||
68 | if(NOT (GNUNET_PSYC_UTIL AND GNUNET_SOCIAL)) | ||
69 | set(GNUNET_SOCIAL_LIBRARIES_OK false) | ||
70 | endif() | ||
71 | |||
72 | # gnunet social include dirs | ||
73 | find_path(GNUNET_SOCIAL_SERVICE_H NAMES gnunet/gnunet_social_service.h) | ||
74 | |||
75 | file(GLOB GNUNET_SOCIAL_INCLUDE_DIRS ${GNUNET_SOCIAL_SERVICE_H}) | ||
76 | set(GNUNET_INCLUDE_DIRS ${GNUNET_INCLUDE_DIRS} ${GNUNET_SOCIAL_INCLUDE_DIRS}) | ||
77 | |||
78 | if(NOT (GNUNET_SOCIAL_SERVICE_H)) | ||
79 | set(GNUNET_SOCIAL_INCLUDE_DIRS false) | ||
80 | endif() | ||
81 | endif() | ||
82 | |||
83 | list(REMOVE_DUPLICATES GNUNET_INCLUDE_DIRS) | ||
84 | |||
85 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNUNET DEFAULT_MSG GNUNET_LIBRARIES_OK | ||
86 | GNUNET_SOCIAL_LIBRARIES_OK | ||
87 | GNUNET_INCLUDE_DIRS_OK | ||
88 | GNUNET_SOCIAL_INCLUDE_DIRS_OK) | ||
89 | |||
90 | mark_as_advanced( | ||
91 | GNUNET_INCLUDE_DIRS | ||
92 | GNUNET_LIBRARIES | ||
93 | ) | ||
diff --git a/trunk/cmake/Modules/FindSIGC++.cmake b/trunk/cmake/Modules/FindSIGC++.cmake new file mode 100644 index 0000000..236ee3d --- /dev/null +++ b/trunk/cmake/Modules/FindSIGC++.cmake | |||
@@ -0,0 +1,43 @@ | |||
1 | # - Try to find SigC++-2.0 | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # SIGC++_FOUND - system has SigC++ | ||
5 | # SIGC++_INCLUDE_DIR - the SigC++ include directory | ||
6 | # SIGC++_LIBRARY - SigC++ library | ||
7 | |||
8 | if(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES) | ||
9 | # Already in cache, be silent | ||
10 | set(SIGC++_FIND_QUIETLY TRUE) | ||
11 | endif(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES) | ||
12 | |||
13 | if (NOT WIN32) | ||
14 | include(FindPkgConfig) | ||
15 | pkgconfig(sigc++-2.0 _LibSIGC++IncDir _LibSIGC++LinkDir _LibSIGC++LinkFlags _LibSIGC++Cflags) | ||
16 | endif(NOT WIN32) | ||
17 | |||
18 | find_path(SIGC++_INCLUDE_DIR sigc++/sigc++.h | ||
19 | PATH_SUFFIXES sigc++-2.0 | ||
20 | PATHS ${_LibSIGC++IncDir} ) | ||
21 | |||
22 | find_library(SIGC++_LIBRARY | ||
23 | NAMES sigc-2.0 | ||
24 | PATHS ${_LibSIGC++LinkDir} ) | ||
25 | |||
26 | get_filename_component(sigc++LibDir "${SIGC++_LIBRARY}" PATH) | ||
27 | |||
28 | # search the sigc++config.h include dir under the same root where the library is found | ||
29 | |||
30 | find_path(SIGC++_CONFIG_INCLUDE_DIR sigc++config.h | ||
31 | PATH_SUFFIXES sigc++-2.0/include | ||
32 | PATHS ${_LibSIGC++IncDir} "${sigc++LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) | ||
33 | |||
34 | # not sure if this include dir is optional or required | ||
35 | # for now it is optional | ||
36 | if(SIGC++_CONFIG_INCLUDE_DIR) | ||
37 | set(SIGC++_INCLUDE_DIR ${SIGC++_INCLUDE_DIR} "${SIGC++_CONFIG_INCLUDE_DIR}") | ||
38 | endif(SIGC++_CONFIG_INCLUDE_DIR) | ||
39 | |||
40 | include(FindPackageHandleStandardArgs) | ||
41 | find_package_handle_standard_args(SIGC++ DEFAULT_MSG SIGC++_LIBRARY SIGC++_INCLUDE_DIR) | ||
42 | |||
43 | mark_as_advanced(SIGC++_INCLUDE_DIR SIGC++_LIBRARY) | ||
diff --git a/trunk/cmake/Modules/FindSigC++.cmake b/trunk/cmake/Modules/FindSigC++.cmake new file mode 100644 index 0000000..1a3daa6 --- /dev/null +++ b/trunk/cmake/Modules/FindSigC++.cmake | |||
@@ -0,0 +1,92 @@ | |||
1 | # - Try to find SIGC++ | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # SIGC++_ROOT_DIR - Set this variable to the root installation of SIGC++ | ||
5 | # SIGC++_FOUND - system has SIGC++ | ||
6 | # SIGC++_INCLUDE_DIRS - the SIGC++ include directory | ||
7 | # SIGC++_LIBRARIES - Link these to use SIGC++ | ||
8 | # | ||
9 | # Copyright (c) 2008 Joshua L. Blocher <verbalshadow at gmail dot com> | ||
10 | # Copyright (c) 2012 Dmitry Baryshnikov <polimax at mail dot ru> | ||
11 | # Copyright (c) 2013 Michael Pavlyshko <pavlushko at tut dot by> | ||
12 | # | ||
13 | # Distributed under the OSI-approved BSD License | ||
14 | # | ||
15 | |||
16 | if (NOT WIN32) | ||
17 | find_package(PkgConfig) | ||
18 | if (PKG_CONFIG_FOUND) | ||
19 | pkg_check_modules(_SIGC++ sigc++-2.0) | ||
20 | endif (PKG_CONFIG_FOUND) | ||
21 | endif (NOT WIN32) | ||
22 | |||
23 | SET(_SIGC++_ROOT_HINTS | ||
24 | $ENV{SIGC++} | ||
25 | ${CMAKE_FIND_ROOT_PATH} | ||
26 | ${SIGC++_ROOT_DIR} | ||
27 | ) | ||
28 | |||
29 | SET(_SIGC++_ROOT_PATHS | ||
30 | $ENV{SIGC++}/src | ||
31 | /usr | ||
32 | /usr/local | ||
33 | ) | ||
34 | |||
35 | SET(_SIGC++_ROOT_HINTS_AND_PATHS | ||
36 | HINTS ${_SIGC++_ROOT_HINTS} | ||
37 | PATHS ${_SIGC++_ROOT_PATHS} | ||
38 | ) | ||
39 | |||
40 | FIND_PATH(SIGC++_INCLUDE_DIR | ||
41 | NAMES | ||
42 | "sigc++/sigc++.h" | ||
43 | HINTS | ||
44 | ${_SIGC++_INCLUDEDIR} | ||
45 | ${_SIGC++_ROOT_HINTS_AND_PATHS} | ||
46 | PATH_SUFFIXES | ||
47 | include | ||
48 | "include/sigc++-2.0" | ||
49 | ) | ||
50 | |||
51 | find_path(SIGC++_CONFIG_INCLUDE_DIR | ||
52 | NAMES | ||
53 | sigc++config.h | ||
54 | HINTS | ||
55 | ${_SIGC++_LIBDIR} | ||
56 | ${_SIGC++_INCLUDEDIR} | ||
57 | ${_SIGC++_ROOT_HINTS_AND_PATHS} | ||
58 | PATH_SUFFIXES | ||
59 | include | ||
60 | lib | ||
61 | "sigc++-2.0/include" | ||
62 | "lib/sigc++-2.0" | ||
63 | "lib/sigc++-2.0/include" | ||
64 | ) | ||
65 | |||
66 | FIND_LIBRARY(SIGC++_LIBRARY | ||
67 | NAMES | ||
68 | sigc-2.0 | ||
69 | HINTS | ||
70 | ${_SIGC++_LIBDIR} | ||
71 | ${_SIGC++_ROOT_HINTS_AND_PATHS} | ||
72 | PATH_SUFFIXES | ||
73 | "lib" | ||
74 | "local/lib" | ||
75 | ) | ||
76 | |||
77 | SET(SIGC++_LIBRARIES | ||
78 | ${SIGC++_LIBRARY} | ||
79 | ) | ||
80 | |||
81 | SET(SIGC++_INCLUDE_DIRS | ||
82 | ${SIGC++_INCLUDE_DIR} | ||
83 | ${SIGC++_CONFIG_INCLUDE_DIR} | ||
84 | ) | ||
85 | |||
86 | include(FindPackageHandleStandardArgs) | ||
87 | find_package_handle_standard_args(SIGC++ "Could NOT find SIGC++, try to set the path to SIGC++ root folder in the system variable SIGC++" | ||
88 | SIGC++_LIBRARIES | ||
89 | SIGC++_INCLUDE_DIRS | ||
90 | ) | ||
91 | |||
92 | MARK_AS_ADVANCED(SIGC++_CONFIG_INCLUDE_DIR SIGC++_INCLUDE_DIR SIGC++_INCLUDE_DIRS SIGC++_LIBRARY SIGC++_LIBRARIES) \ No newline at end of file | ||