Mercurial > hg > orthanc-wsi
comparison Resources/Orthanc/DownloadOrthancFramework.cmake @ 194:e57e6ca5303d
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Jun 2020 18:03:23 +0200 |
parents | e690c265b315 |
children | b0bd22077cd8 |
comparison
equal
deleted
inserted
replaced
193:e690c265b315 | 194:e57e6ca5303d |
---|---|
193 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}) | 193 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}) |
194 message(FATAL_ERROR "Non-existing directory: ${ORTHANC_FRAMEWORK_ROOT}") | 194 message(FATAL_ERROR "Non-existing directory: ${ORTHANC_FRAMEWORK_ROOT}") |
195 endif() | 195 endif() |
196 | 196 |
197 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | 197 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) |
198 message(FATAL_ERROR "Directory not containing the source code of Orthanc: ${ORTHANC_FRAMEWORK_ROOT}") | 198 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}") |
199 endif() | 199 endif() |
200 | |
201 set(ORTHANC_ROOT ${ORTHANC_FRAMEWORK_ROOT}) | |
202 endif() | 200 endif() |
203 | 201 |
204 | 202 |
205 | 203 |
206 ## | 204 ## |
243 ) | 241 ) |
244 | 242 |
245 if (Failure) | 243 if (Failure) |
246 message(FATAL_ERROR "Error while running Mercurial") | 244 message(FATAL_ERROR "Error while running Mercurial") |
247 endif() | 245 endif() |
246 | |
247 unset(ORTHANC_FRAMEWORK_ROOT CACHE) | |
248 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE | |
249 STRING "Path to the Orthanc framework source directory") | |
250 | |
251 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | |
252 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") | |
253 endif() | |
254 | |
255 unset(ORTHANC_ROOT) | |
248 endif() | 256 endif() |
249 | 257 |
250 | 258 |
251 | 259 |
252 ## | 260 ## |
370 | 378 |
371 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") | 379 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") |
372 message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") | 380 message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") |
373 endif() | 381 endif() |
374 endif() | 382 endif() |
383 | |
384 unset(ORTHANC_FRAMEWORK_ROOT CACHE) | |
385 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE | |
386 STRING "Path to the Orthanc framework source directory") | |
387 | |
388 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | |
389 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") | |
390 endif() | |
391 | |
392 unset(ORTHANC_ROOT) | |
375 endif() | 393 endif() |
376 | 394 |
377 | 395 |
378 | 396 |
379 ## | 397 ## |
397 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) | 415 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) |
398 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) | 416 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) |
399 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) | 417 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) |
400 set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) | 418 set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) |
401 | 419 |
402 if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND | 420 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR |
403 NOT ORTHANC_FRAMEWORK_STATIC) | 421 ORTHANC_FRAMEWORK_STATIC) |
422 include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) | |
423 else() | |
404 # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) | 424 # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) |
405 find_path(JSONCPP_INCLUDE_DIR json/reader.h | 425 find_path(JSONCPP_INCLUDE_DIR json/reader.h |
406 /usr/include/jsoncpp | 426 /usr/include/jsoncpp |
407 /usr/local/include/jsoncpp | 427 /usr/local/include/jsoncpp |
408 ) | 428 ) |
445 if (NOT HAVE_SQLITE_H) | 465 if (NOT HAVE_SQLITE_H) |
446 message(FATAL_ERROR "Please install the libsqlite3-dev package") | 466 message(FATAL_ERROR "Please install the libsqlite3-dev package") |
447 endif() | 467 endif() |
448 link_libraries(sqlite3) | 468 link_libraries(sqlite3) |
449 endif() | 469 endif() |
470 | |
471 # Optional component - Pugixml | |
472 if (ENABLE_PUGIXML) | |
473 CHECK_INCLUDE_FILE_CXX(pugixml.hpp HAVE_PUGIXML_H) | |
474 if (NOT HAVE_PUGIXML_H) | |
475 message(FATAL_ERROR "Please install the libpugixml-dev package") | |
476 endif() | |
477 link_libraries(pugixml) | |
478 endif() | |
479 | |
480 # Optional component - DCMTK | |
481 if (ENABLE_DCMTK) | |
482 include(FindDCMTK) | |
483 include_directories(${DCMTK_INCLUDE_DIRS}) | |
484 link_libraries(${DCMTK_LIBRARIES}) | |
485 endif() | |
450 endif() | 486 endif() |
451 | 487 |
452 # Optional component - Google Test | 488 # Optional component - Google Test |
453 if (ENABLE_GOOGLE_TEST) | 489 if (ENABLE_GOOGLE_TEST) |
454 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") | 490 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") |
460 # Look for Orthanc framework shared library | 496 # Look for Orthanc framework shared library |
461 include(CheckCXXSymbolExists) | 497 include(CheckCXXSymbolExists) |
462 | 498 |
463 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | 499 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") |
464 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) | 500 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) |
465 include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) | |
466 else() | 501 else() |
467 find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h | 502 find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h |
468 /usr/include/orthanc-framework | 503 /usr/include/orthanc-framework |
469 /usr/local/include/orthanc-framework | 504 /usr/local/include/orthanc-framework |
470 ${ORTHANC_FRAMEWORK_ROOT} | 505 ${ORTHANC_FRAMEWORK_ROOT} |