summaryrefslogtreecommitdiff
path: root/trunk/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/cmake')
-rw-r--r--trunk/cmake/Modules/FindGnunet.cmake93
-rw-r--r--trunk/cmake/Modules/FindSIGC++.cmake43
-rw-r--r--trunk/cmake/Modules/FindSigC++.cmake92
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
17include(CheckLibraryExists)
18include(FindPackageHandleStandardArgs)
19
20set(GNUNET_LIBRARIES_OK true)
21set(GNUNET_SOCIAL_LIBRARIES_OK true)
22set(GNUNET_INCLUDE_DIRS_OK true)
23set(GNUNET_SOCIAL_INCLUDE_DIRS_OK true)
24
25# gnunet libraries
26find_library(GNUNET_CORE_LIB NAMES gnunetcore)
27find_library(GNUNET_UTIL_LIB NAMES gnunetutil)
28find_library(GNUNET_IDENTITY_LIB NAMES gnunetidentity)
29find_library(GNUNET_ARM_LIB NAMES gnunetarm)
30find_library(GNUNET_FRIENDS_LIB NAMES gnunetfriends)
31
32file(GLOB GNUNET_LIBRARIES ${GNUNET_CORE_LIB}
33 ${GNUNET_UTIL_LIB}
34 ${GNUNET_IDENTITY_LIB}
35 ${GNUNET_ARM_LIB}
36 ${GNUNET_FRIENDS_LIB})
37
38if(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)
44endif()
45
46# gnunet include dirs
47find_path(GNUNET_PLATFORM_H NAMES gnunet/platform.h)
48find_path(GNUNET_UTIL_LIB_H NAMES gnunet/gnunet_util_lib.h)
49
50file(GLOB GNUNET_INCLUDE_DIRS ${GNUNET_PLATFORM_H}
51 ${GNUNET_UTIL_LIB_H})
52
53if(NOT (GNUNET_PLATFORM_H AND
54 GNUNET_UTIL_LIB_H))
55 set(GNUNET_INCLUDE_DIRS_OK false)
56endif()
57
58# gnunet social API
59if(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()
81endif()
82
83list(REMOVE_DUPLICATES GNUNET_INCLUDE_DIRS)
84
85FIND_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
90mark_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
8if(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES)
9 # Already in cache, be silent
10 set(SIGC++_FIND_QUIETLY TRUE)
11endif(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES)
12
13if (NOT WIN32)
14 include(FindPkgConfig)
15 pkgconfig(sigc++-2.0 _LibSIGC++IncDir _LibSIGC++LinkDir _LibSIGC++LinkFlags _LibSIGC++Cflags)
16endif(NOT WIN32)
17
18find_path(SIGC++_INCLUDE_DIR sigc++/sigc++.h
19 PATH_SUFFIXES sigc++-2.0
20 PATHS ${_LibSIGC++IncDir} )
21
22find_library(SIGC++_LIBRARY
23 NAMES sigc-2.0
24 PATHS ${_LibSIGC++LinkDir} )
25
26get_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
30find_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
36if(SIGC++_CONFIG_INCLUDE_DIR)
37 set(SIGC++_INCLUDE_DIR ${SIGC++_INCLUDE_DIR} "${SIGC++_CONFIG_INCLUDE_DIR}")
38endif(SIGC++_CONFIG_INCLUDE_DIR)
39
40include(FindPackageHandleStandardArgs)
41find_package_handle_standard_args(SIGC++ DEFAULT_MSG SIGC++_LIBRARY SIGC++_INCLUDE_DIR)
42
43mark_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
16if (NOT WIN32)
17 find_package(PkgConfig)
18 if (PKG_CONFIG_FOUND)
19 pkg_check_modules(_SIGC++ sigc++-2.0)
20 endif (PKG_CONFIG_FOUND)
21endif (NOT WIN32)
22
23SET(_SIGC++_ROOT_HINTS
24 $ENV{SIGC++}
25 ${CMAKE_FIND_ROOT_PATH}
26 ${SIGC++_ROOT_DIR}
27)
28
29SET(_SIGC++_ROOT_PATHS
30 $ENV{SIGC++}/src
31 /usr
32 /usr/local
33)
34
35SET(_SIGC++_ROOT_HINTS_AND_PATHS
36 HINTS ${_SIGC++_ROOT_HINTS}
37 PATHS ${_SIGC++_ROOT_PATHS}
38)
39
40FIND_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
51find_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
66FIND_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
77SET(SIGC++_LIBRARIES
78 ${SIGC++_LIBRARY}
79)
80
81SET(SIGC++_INCLUDE_DIRS
82 ${SIGC++_INCLUDE_DIR}
83 ${SIGC++_CONFIG_INCLUDE_DIR}
84)
85
86include(FindPackageHandleStandardArgs)
87find_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
92MARK_AS_ADVANCED(SIGC++_CONFIG_INCLUDE_DIR SIGC++_INCLUDE_DIR SIGC++_INCLUDE_DIRS SIGC++_LIBRARY SIGC++_LIBRARIES) \ No newline at end of file