annotate OrthancFramework/Resources/CMake/UuidConfiguration.cmake @ 4533:409cba9c1dba Orthanc-1.9.1

Orthanc-1.9.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Feb 2021 16:59:24 +0100
parents d9473bd5ed43
children 7053502fbf97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4120
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 ##
4325
b96aedfa8cc1 unit tests now running in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4120
diff changeset
38 ## 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
39 ## WebAssembly (used in Stone)
2917
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
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
42 execute_process(
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
43 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
4325
b96aedfa8cc1 unit tests now running in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4120
diff changeset
44 ${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
45 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
46 RESULT_VARIABLE Failure
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
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
49 if (FirstRun AND Failure)
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
50 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
51 endif()
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
52
ebd2c9ba66c4 patch for compatibility with Cocoa on OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2916
diff changeset
53
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 include_directories(
2916
c226799724bf place include directory for static libuuid at highest priority
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2524
diff changeset
55 BEFORE ${E2FSPROGS_SOURCES_DIR}/lib
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 )
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
2453
c50413a4092c missing generated file in e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2452
diff changeset
58 set(UUID_SOURCES
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 )
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
2455
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
72 check_include_file("net/if.h" HAVE_NET_IF_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
73 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
74 check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
75 check_include_file("stdlib.h" HAVE_STDLIB_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
76 check_include_file("sys/file.h" HAVE_SYS_FILE_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
77 check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
78 check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
79 check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
80 check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
81 check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
82 check_include_file("sys/time.h" HAVE_SYS_TIME_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
83 check_include_file("sys/un.h" HAVE_SYS_UN_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
84 check_include_file("unistd.h" HAVE_UNISTD_H)
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
85
2524
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
86 if (NOT HAVE_NET_IF_H) # This is the case of OpenBSD
2461
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
87 unset(HAVE_NET_IF_H CACHE)
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
88 check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H)
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
89 endif()
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
90
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
91 if (NOT HAVE_NETINET_TCP_H) # This is the case of OpenBSD
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
92 unset(HAVE_NETINET_TCP_H CACHE)
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
93 check_include_files("sys/socket.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
94 endif()
47029de27a74 fix for openbsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2455
diff changeset
95
2524
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
96 if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h)
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
97 file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake "
2455
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
98 #cmakedefine HAVE_NET_IF_H \@HAVE_NET_IF_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
99 #cmakedefine HAVE_NET_IF_DL_H \@HAVE_NET_IF_DL_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
100 #cmakedefine HAVE_NETINET_IN_H \@HAVE_NETINET_IN_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
101 #cmakedefine HAVE_STDLIB_H \@HAVE_STDLIB_H \@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
102 #cmakedefine HAVE_SYS_FILE_H \@HAVE_SYS_FILE_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
103 #cmakedefine HAVE_SYS_IOCTL_H \@HAVE_SYS_IOCTL_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
104 #cmakedefine HAVE_SYS_RESOURCE_H \@HAVE_SYS_RESOURCE_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
105 #cmakedefine HAVE_SYS_SOCKET_H \@HAVE_SYS_SOCKET_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
106 #cmakedefine HAVE_SYS_SOCKIO_H \@HAVE_SYS_SOCKIO_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
107 #cmakedefine HAVE_SYS_SYSCALL_H \@HAVE_SYS_SYSCALL_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
108 #cmakedefine HAVE_SYS_TIME_H \@HAVE_SYS_TIME_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
109 #cmakedefine HAVE_SYS_UN_H \@HAVE_SYS_UN_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
110 #cmakedefine HAVE_UNISTD_H \@HAVE_UNISTD_H\@
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
111 ")
2524
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
112 endif()
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
113
2455
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
114 configure_file(
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
115 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
116 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h
6b3c0d5f65af improved e2fsprogs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2453
diff changeset
117 )
2524
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
118
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 configure_file(
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 )
2452
383337f21655 fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2450
diff changeset
123
2524
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
124 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
125 file(WRITE
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
126 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
127 "#include <stdint.h>\n")
a29ffb73f6fd optimization in cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2461
diff changeset
128 endif()
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*)
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 else()
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H)
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 if (NOT HAVE_UUID_H)
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 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
136 endif()
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
3337
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
138 find_library(LIBUUID uuid
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
139 PATHS
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
140 /usr/lib
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
141 /usr/local/lib
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
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
144 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
145 if (NOT HAVE_LIBUUID)
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 message(FATAL_ERROR "Unable to find the uuid library")
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 endif()
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
3337
9c8e119d0c5b fix detection of uuid on freebsd
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3289
diff changeset
149 link_libraries(${LIBUUID})
2450
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 endif()
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
ade8b4ddd8a6 Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 endif()