Mercurial > hg > orthanc
comparison Resources/CMake/Compiler.cmake @ 2450:ade8b4ddd8a6
Static linking against libuuid
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Jan 2018 11:02:59 +0100 |
parents | 862d943115f9 |
children | cbb8deaacdf7 |
comparison
equal
deleted
inserted
replaced
2449:e779c11c8eb2 | 2450:ade8b4ddd8a6 |
---|---|
86 endif() | 86 endif() |
87 | 87 |
88 # Remove the "-rdynamic" option | 88 # Remove the "-rdynamic" option |
89 # http://www.mail-archive.com/cmake@cmake.org/msg08837.html | 89 # http://www.mail-archive.com/cmake@cmake.org/msg08837.html |
90 set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") | 90 set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") |
91 link_libraries(uuid pthread) | 91 link_libraries(pthread) |
92 | 92 |
93 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") | 93 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") |
94 link_libraries(rt) | 94 link_libraries(rt) |
95 endif() | 95 endif() |
96 | 96 |
114 # https://ohse.de/uwe/articles/lfs.html | 114 # https://ohse.de/uwe/articles/lfs.html |
115 add_definitions( | 115 add_definitions( |
116 -D_LARGEFILE64_SOURCE=1 | 116 -D_LARGEFILE64_SOURCE=1 |
117 -D_FILE_OFFSET_BITS=64 | 117 -D_FILE_OFFSET_BITS=64 |
118 ) | 118 ) |
119 endif() | |
120 | |
121 CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H) | |
122 if (NOT HAVE_UUID_H) | |
123 message(FATAL_ERROR "Please install the uuid-dev package (or e2fsprogs if OpenBSD)") | |
124 endif() | 119 endif() |
125 | 120 |
126 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | 121 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
127 if (MSVC) | 122 if (MSVC) |
128 message("MSVC compiler version = " ${MSVC_VERSION} "\n") | 123 message("MSVC compiler version = " ${MSVC_VERSION} "\n") |
173 add_definitions( | 168 add_definitions( |
174 -D_XOPEN_SOURCE=1 | 169 -D_XOPEN_SOURCE=1 |
175 ) | 170 ) |
176 link_libraries(iconv) | 171 link_libraries(iconv) |
177 | 172 |
178 CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H) | |
179 if (NOT HAVE_UUID_H) | |
180 message(FATAL_ERROR "Please install the uuid-dev package") | |
181 endif() | |
182 | |
183 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") | 173 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
184 message("Building using Emscripten (for WebAssembly or asm.js targets)") | 174 message("Building using Emscripten (for WebAssembly or asm.js targets)") |
185 | 175 |
186 else() | 176 else() |
187 message(FATAL_ERROR "Support your platform here") | 177 message(FATAL_ERROR "Support your platform here") |