annotate OrthancFramework/Resources/CMake/UuidConfiguration.cmake @ 5640:f7adfb22e20e

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