Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/UuidConfiguration.cmake @ 4843:93ef0342850e
reintroduce -std=c++11 for macOS
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Dec 2021 12:54:42 +0100 |
parents | 7053502fbf97 |
children | 43e613a7756b |
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 |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4325
diff
changeset
|
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
4831
7053502fbf97
added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
5 # Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
6 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
7 # 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
|
8 # 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
|
9 # 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
|
10 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
11 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
12 # 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
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
14 # 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
|
15 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
16 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
17 # 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
|
18 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
19 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
20 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
21 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 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
|
25 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
|
26 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
|
27 SET(E2FSPROGS_MD5 "8d78b11d04d26c0b2dd149529441fa80") |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
29 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
|
30 set(FirstRun OFF) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
31 else() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
32 set(FirstRun ON) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
33 endif() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
34 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
2917
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 ## |
4325
b96aedfa8cc1
unit tests now running in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
39 ## Patch for OS X, in order to be compatible with Cocoa, and for |
b96aedfa8cc1
unit tests now running in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
40 ## WebAssembly (used in Stone) |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
41 ## |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
42 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
43 execute_process( |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
44 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4325
b96aedfa8cc1
unit tests now running in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
45 ${CMAKE_CURRENT_LIST_DIR}/../Patches/e2fsprogs-1.44.5.patch |
2917
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
46 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
47 RESULT_VARIABLE Failure |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
48 ) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
49 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
50 if (FirstRun AND Failure) |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
51 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
|
52 endif() |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
53 |
ebd2c9ba66c4
patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2916
diff
changeset
|
54 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 include_directories( |
2916
c226799724bf
place include directory for static libuuid at highest priority
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2524
diff
changeset
|
56 BEFORE ${E2FSPROGS_SOURCES_DIR}/lib |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
2453
c50413a4092c
missing generated file in e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2452
diff
changeset
|
59 set(UUID_SOURCES |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
73 check_include_file("net/if.h" HAVE_NET_IF_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
74 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
|
75 check_include_file("netinet/in.h" HAVE_NETINET_IN_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
76 check_include_file("stdlib.h" HAVE_STDLIB_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
77 check_include_file("sys/file.h" HAVE_SYS_FILE_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
78 check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
79 check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
80 check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
81 check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
82 check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
83 check_include_file("sys/time.h" HAVE_SYS_TIME_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
84 check_include_file("sys/un.h" HAVE_SYS_UN_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
85 check_include_file("unistd.h" HAVE_UNISTD_H) |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
86 |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
87 if (NOT HAVE_NET_IF_H) # This is the case of OpenBSD |
2461 | 88 unset(HAVE_NET_IF_H CACHE) |
89 check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H) | |
90 endif() | |
91 | |
92 if (NOT HAVE_NETINET_TCP_H) # This is the case of OpenBSD | |
93 unset(HAVE_NETINET_TCP_H CACHE) | |
94 check_include_files("sys/socket.h;netinet/tcp.h" HAVE_NETINET_TCP_H) | |
95 endif() | |
96 | |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
97 if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h) |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
98 file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake " |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
99 #cmakedefine HAVE_NET_IF_H \@HAVE_NET_IF_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
100 #cmakedefine HAVE_NET_IF_DL_H \@HAVE_NET_IF_DL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
101 #cmakedefine HAVE_NETINET_IN_H \@HAVE_NETINET_IN_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
102 #cmakedefine HAVE_STDLIB_H \@HAVE_STDLIB_H \@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
103 #cmakedefine HAVE_SYS_FILE_H \@HAVE_SYS_FILE_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
104 #cmakedefine HAVE_SYS_IOCTL_H \@HAVE_SYS_IOCTL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
105 #cmakedefine HAVE_SYS_RESOURCE_H \@HAVE_SYS_RESOURCE_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
106 #cmakedefine HAVE_SYS_SOCKET_H \@HAVE_SYS_SOCKET_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
107 #cmakedefine HAVE_SYS_SOCKIO_H \@HAVE_SYS_SOCKIO_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
108 #cmakedefine HAVE_SYS_SYSCALL_H \@HAVE_SYS_SYSCALL_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
109 #cmakedefine HAVE_SYS_TIME_H \@HAVE_SYS_TIME_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
110 #cmakedefine HAVE_SYS_UN_H \@HAVE_SYS_UN_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
111 #cmakedefine HAVE_UNISTD_H \@HAVE_UNISTD_H\@ |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
112 ") |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
113 endif() |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
114 |
2455
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
115 configure_file( |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
116 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
117 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h |
6b3c0d5f65af
improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2453
diff
changeset
|
118 ) |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
119 |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 configure_file( |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 ) |
2452 | 124 |
2524
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
125 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
|
126 file(WRITE |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
127 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
128 "#include <stdint.h>\n") |
a29ffb73f6fd
optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2461
diff
changeset
|
129 endif() |
2450
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 source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 else() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 if (NOT HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 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
|
137 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 |
3337
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
139 find_library(LIBUUID uuid |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
140 PATHS |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
141 /usr/lib |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
142 /usr/local/lib |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
143 ) |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
144 |
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
145 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
|
146 if (NOT HAVE_LIBUUID) |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 message(FATAL_ERROR "Unable to find the uuid library") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 |
3337
9c8e119d0c5b
fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3289
diff
changeset
|
150 link_libraries(${LIBUUID}) |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 endif() |