Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
2449:e779c11c8eb2 | 2450:ade8b4ddd8a6 |
---|---|
1 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
2 | |
3 if (STATIC_BUILD OR NOT USE_SYSTEM_UUID) | |
4 SET(E2FSPROGS_SOURCES_DIR ${CMAKE_BINARY_DIR}/e2fsprogs-1.43.8) | |
5 SET(E2FSPROGS_URL "http://www.orthanc-server.com/downloads/third-party/e2fsprogs-1.43.8.tar.gz") | |
6 SET(E2FSPROGS_MD5 "670b7a74a8ead5333acf21b9afc92b3c") | |
7 | |
8 DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}") | |
9 | |
10 include_directories( | |
11 ${E2FSPROGS_SOURCES_DIR}/lib | |
12 ) | |
13 | |
14 set(E2FSPROGS_SOURCES | |
15 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c | |
16 #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c | |
17 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c | |
18 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c | |
19 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c | |
20 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c | |
21 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c | |
22 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c | |
23 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c | |
24 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c | |
25 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c | |
26 ) | |
27 | |
28 configure_file( | |
29 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in | |
30 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h | |
31 ) | |
32 | |
33 configure_file( | |
34 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h.in | |
35 ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h | |
36 ) | |
37 | |
38 source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*) | |
39 | |
40 else() | |
41 CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H) | |
42 if (NOT HAVE_UUID_H) | |
43 message(FATAL_ERROR "Please install uuid-dev, e2fsprogs (OpenBSD) or e2fsprogs-libuuid (FreeBSD)") | |
44 endif() | |
45 | |
46 check_library_exists(uuid uuid_generate_random "" HAVE_UUID_LIB) | |
47 if (NOT HAVE_UUID_LIB) | |
48 message(FATAL_ERROR "Unable to find the uuid library") | |
49 endif() | |
50 | |
51 link_libraries(uuid) | |
52 endif() | |
53 | |
54 endif() |