toolchain: bump Codescape IMG MIPS version to 2016.05-06
[buildroot-gz.git] / package / taskd / 0003-CMakeLists-use-pkg-config-uuid-detection.patch
blob34139fef74e1c5bcca9aaf1e966d12147e606ab3
1 CMakeLists.txt: use pkg-config to detect uuid when possible
3 In order to take into account the libraries used by libuuid when
4 building statically, using pkg-config is recommended. This patch
5 therefore improves the CMakeLists.txt to use pkg-config to detect
6 libuuid when pkg-config is available.
8 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Index: b/CMakeLists.txt
11 ===================================================================
12 --- a/CMakeLists.txt
13 +++ b/CMakeLists.txt
14 @@ -6,6 +6,7 @@
16 include (CheckFunctionExists)
17 include (CheckStructHasMember)
18 +include (FindPkgConfig)
20 set (HAVE_CMAKE true)
22 @@ -119,8 +120,16 @@
23 # Apple and FreeBSD include the uuid functions in their libc, rather than libuuid
24 check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
25 else (DARWIN OR FREEBSD)
26 - find_path (UUID_INCLUDE_DIR uuid/uuid.h)
27 - find_library (UUID_LIBRARY NAMES uuid)
28 + if(PKG_CONFIG_FOUND)
29 + pkg_check_modules(PC_UUID uuid)
30 + if(PC_UUID_FOUND)
31 + set (UUID_INCLUDE_DIR ${PC_UUID_INCLUDE_DIRS})
32 + set (UUID_LIBRARY ${PC_UUID_LIBRARIES})
33 + endif(PC_UUID_FOUND)
34 + else(PKG_CONFIG_FOUND)
35 + find_path (UUID_INCLUDE_DIR uuid/uuid.h)
36 + find_library (UUID_LIBRARY NAMES uuid)
37 + endif(PKG_CONFIG_FOUND)
38 if (UUID_INCLUDE_DIR AND UUID_LIBRARY)
39 set (TASKD_INCLUDE_DIRS ${TASKD_INCLUDE_DIRS} ${UUID_INCLUDE_DIR})
40 set (TASKD_LIBRARIES ${TASKD_LIBRARIES} ${UUID_LIBRARY})