Mercurial > hg > orthanc
annotate Resources/CMake/UuidConfiguration.cmake @ 2450:ade8b4ddd8a6
Static linking against libuuid
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Jan 2018 11:02:59 +0100 |
parents | |
children | 383337f21655 |
rev | line source |
---|---|
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 if (STATIC_BUILD OR NOT USE_SYSTEM_UUID) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 SET(E2FSPROGS_SOURCES_DIR ${CMAKE_BINARY_DIR}/e2fsprogs-1.43.8) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 SET(E2FSPROGS_URL "http://www.orthanc-server.com/downloads/third-party/e2fsprogs-1.43.8.tar.gz") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 SET(E2FSPROGS_MD5 "670b7a74a8ead5333acf21b9afc92b3c") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 include_directories( |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 ${E2FSPROGS_SOURCES_DIR}/lib |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 set(E2FSPROGS_SOURCES |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 configure_file( |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 configure_file( |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h.in |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 ) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 else() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 if (NOT HAVE_UUID_H) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 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
|
44 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 check_library_exists(uuid uuid_generate_random "" HAVE_UUID_LIB) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 if (NOT HAVE_UUID_LIB) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 message(FATAL_ERROR "Unable to find the uuid library") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 link_libraries(uuid) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 endif() |