Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/UuidConfiguration.cmake @ 4544:ae63b301d522 Orthanc-1.7.4
close branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 02 Mar 2021 16:52:26 +0100 |
parents | 304842a0d152 |
children | b96aedfa8cc1 |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
5 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
6 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
7 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
8 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
9 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
10 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
12 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
14 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
15 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
16 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
17 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
18 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
19 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
20 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 if (STATIC_BUILD OR NOT USE_SYSTEM_UUID) |
3289
afc38fd21c78
upgrade to e2fsprogs 1.44.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
24 SET(E2FSPROGS_SOURCES_DIR ${CMAKE_BINARY_DIR}/e2fsprogs-1.44.5) |
afc38fd21c78
upgrade to e2fsprogs 1.44.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
25 SET(E2FSPROGS_URL "http://orthanc.osimis.io/ThirdPartyDownloads/e2fsprogs-1.44.5.tar.gz") |
afc38fd21c78
upgrade to e2fsprogs 1.44.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
26 SET(E2FSPROGS_MD5 "8d78b11d04d26c0b2dd149529441fa80") |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
28 if (IS_DIRECTORY "${E2FSPROGS_SOURCES_DIR}") |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
29 set(FirstRun OFF) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
30 else() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
31 set(FirstRun ON) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
32 endif() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
33 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
36 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
37 ## |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
38 ## Patch for OS X, in order to be compatible with Cocoa (used in Stone) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
39 ## |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
40 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
41 execute_process( |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
42 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 43 ${CMAKE_CURRENT_LIST_DIR}/../Patches/e2fsprogs-1.44.5-apple.patch |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
44 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
45 RESULT_VARIABLE Failure |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
46 ) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
47 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
48 if (FirstRun AND Failure) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
49 message(FATAL_ERROR "Error while patching a file") |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
50 endif() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
51 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
52 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 include_directories( |
2916
c226799724bf
place include directory for static libuuid at highest priority
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2524
diff
changeset
|
54 BEFORE ${E2FSPROGS_SOURCES_DIR}/lib |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
2453
c50413a4092c
missing generated file in e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2452
diff
changeset
|
57 set(UUID_SOURCES |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
71 check_include_file("net/if.h" HAVE_NET_IF_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
72 check_include_file("net/if_dl.h" HAVE_NET_IF_DL_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
73 check_include_file("netinet/in.h" HAVE_NETINET_IN_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
74 check_include_file("stdlib.h" HAVE_STDLIB_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
75 check_include_file("sys/file.h" HAVE_SYS_FILE_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
76 check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
77 check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
78 check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
79 check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
80 check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
81 check_include_file("sys/time.h" HAVE_SYS_TIME_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
82 check_include_file("sys/un.h" HAVE_SYS_UN_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
83 check_include_file("unistd.h" HAVE_UNISTD_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
84 |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
85 if (NOT HAVE_NET_IF_H) # This is the case of OpenBSD |
2461 | 86 unset(HAVE_NET_IF_H CACHE) |
87 check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H) | |
88 endif() | |
89 | |
90 if (NOT HAVE_NETINET_TCP_H) # This is the case of OpenBSD | |
91 unset(HAVE_NETINET_TCP_H CACHE) | |
92 check_include_files("sys/socket.h;netinet/tcp.h" HAVE_NETINET_TCP_H) | |
93 endif() | |
94 | |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
95 if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h) |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
96 file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake " |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
97 #cmakedefine HAVE_NET_IF_H \@HAVE_NET_IF_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
98 #cmakedefine HAVE_NET_IF_DL_H \@HAVE_NET_IF_DL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
99 #cmakedefine HAVE_NETINET_IN_H \@HAVE_NETINET_IN_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
100 #cmakedefine HAVE_STDLIB_H \@HAVE_STDLIB_H \@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
101 #cmakedefine HAVE_SYS_FILE_H \@HAVE_SYS_FILE_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
102 #cmakedefine HAVE_SYS_IOCTL_H \@HAVE_SYS_IOCTL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
103 #cmakedefine HAVE_SYS_RESOURCE_H \@HAVE_SYS_RESOURCE_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
104 #cmakedefine HAVE_SYS_SOCKET_H \@HAVE_SYS_SOCKET_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
105 #cmakedefine HAVE_SYS_SOCKIO_H \@HAVE_SYS_SOCKIO_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
106 #cmakedefine HAVE_SYS_SYSCALL_H \@HAVE_SYS_SYSCALL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
107 #cmakedefine HAVE_SYS_TIME_H \@HAVE_SYS_TIME_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
108 #cmakedefine HAVE_SYS_UN_H \@HAVE_SYS_UN_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
109 #cmakedefine HAVE_UNISTD_H \@HAVE_UNISTD_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
110 ") |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
111 endif() |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
112 |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
113 configure_file( |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
114 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
115 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
116 ) |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
117 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 configure_file( |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 ) |
2452 | 122 |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
123 if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h) |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
124 file(WRITE |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
125 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
126 "#include <stdint.h>\n") |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
127 endif() |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 else() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 if (NOT HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 message(FATAL_ERROR "Please install uuid-dev, e2fsprogs (OpenBSD) or e2fsprogs-libuuid (FreeBSD)") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 |
3337
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
137 find_library(LIBUUID uuid |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
138 PATHS |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
139 /usr/lib |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
140 /usr/local/lib |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
141 ) |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
142 |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
143 check_library_exists(${LIBUUID} uuid_generate_random "" HAVE_LIBUUID) |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
144 if (NOT HAVE_LIBUUID) |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 message(FATAL_ERROR "Unable to find the uuid library") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 |
3337
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
148 link_libraries(${LIBUUID}) |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 endif() |