Mercurial > hg > orthanc-stl
comparison Resources/CMake/LibNiftiConfiguration.cmake @ 6:c02d12eb34d4
added LoadNifti()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 18 Jul 2023 14:45:20 +0200 |
parents | |
children | c47512eb4880 |
comparison
equal
deleted
inserted
replaced
5:1cc024bb662a | 6:c02d12eb34d4 |
---|---|
1 # SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium | |
2 # SPDX-License-Identifier: GPL-3.0-or-later | |
3 | |
4 # STL plugin for Orthanc | |
5 # Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium | |
6 # | |
7 # This program is free software: you can redistribute it and/or | |
8 # modify it under the terms of the GNU General Public License as | |
9 # published by the Free Software Foundation, either version 3 of the | |
10 # License, or (at your option) any later version. | |
11 # | |
12 # This program is distributed in the hope that it will be useful, but | |
13 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 # General Public License for more details. | |
16 # | |
17 # You should have received a copy of the GNU General Public License | |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 | |
21 if (STATIC_BUILD OR NOT USE_SYSTEM_NIFTILIB) | |
22 set(NIFTILIB_SOURCES_DIR ${CMAKE_BINARY_DIR}/nifti_clib-3.0.0) | |
23 DownloadPackage( | |
24 "ee40068103775a181522166e435ee82d" | |
25 "https://third-party.orthanc-labs.com/nifti_clib-3.0.0.tar.gz" | |
26 "${NIFTILIB_SOURCES_DIR}") | |
27 | |
28 include_directories( | |
29 ${NIFTILIB_SOURCES_DIR}/niftilib | |
30 ${NIFTILIB_SOURCES_DIR}/znzlib | |
31 ) | |
32 | |
33 add_definitions( | |
34 -DHAVE_ZLIB=1 | |
35 ) | |
36 | |
37 set(NIFTILIB_SOURCES | |
38 ${NIFTILIB_SOURCES_DIR}/niftilib/nifti1_io.c | |
39 ${NIFTILIB_SOURCES_DIR}/znzlib/znzlib.c | |
40 ) | |
41 | |
42 else() | |
43 find_path(NIFTILIB_INCLUDE_DIR | |
44 NAMES nifti1.h | |
45 PATHS | |
46 /usr/include | |
47 /usr/include/nifti | |
48 /usr/local/include | |
49 /usr/local/include/nifti | |
50 ) | |
51 | |
52 check_include_file(${NIFTILIB_INCLUDE_DIR}/nifti1.h HAVE_NIFTILIB_H) | |
53 if (NOT HAVE_NIFTILIB_H) | |
54 message(FATAL_ERROR "Please install the libnifti-dev package") | |
55 endif() | |
56 | |
57 include_directories(${NIFTILIB_INCLUDE_DIR}) | |
58 | |
59 link_libraries(niftiio znz) | |
60 endif() |