Mercurial > hg > orthanc
comparison CMakeLists.txt @ 3622:8afc14fab01f
New sample plugin: ConnectivityChecks
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 24 Jan 2020 17:06:23 +0100 |
parents | 54cdad5a7228 |
children | a6bfa09df8b3 |
comparison
equal
deleted
inserted
replaced
3620:649489b9bfdb | 3622:8afc14fab01f |
---|---|
35 | 35 |
36 # Parameters of the build | 36 # Parameters of the build |
37 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists") | 37 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists") |
38 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc") | 38 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc") |
39 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") | 39 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") |
40 SET(BUILD_CONNECTIVITY_CHECKS ON CACHE BOOL "Whether to build the ConnectivityChecks plugin") | |
40 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") | 41 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") |
41 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") | 42 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") |
42 | 43 |
43 | 44 |
44 ##################################################################### | 45 ##################################################################### |
459 endif() | 460 endif() |
460 | 461 |
461 | 462 |
462 | 463 |
463 ##################################################################### | 464 ##################################################################### |
465 ## Build the "ConnectivityChecks" plugin | |
466 ##################################################################### | |
467 | |
468 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) | |
469 include(ExternalProject) | |
470 | |
471 unset(Flags) | |
472 | |
473 if (CMAKE_TOOLCHAIN_FILE) | |
474 # Take absolute path to the toolchain | |
475 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | |
476 list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | |
477 endif() | |
478 | |
479 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
480 list(APPEND Flags | |
481 -DLSB_CC=$ENV{LSB_CC} | |
482 -DLSB_CXX=$ENV{LSB_CXX} | |
483 ) | |
484 endif() | |
485 | |
486 externalproject_add(ConnectivityChecksProject | |
487 SOURCE_DIR "${ORTHANC_ROOT}/Plugins/Samples/ConnectivityChecks" | |
488 | |
489 CMAKE_ARGS | |
490 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | |
491 -DPLUGIN_VERSION=${ORTHANC_VERSION} | |
492 -DSTATIC_BUILD=${STATIC_BUILD} | |
493 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | |
494 ${Flags} | |
495 | |
496 INSTALL_COMMAND "" # Skip the install step | |
497 ) | |
498 | |
499 ExternalProject_Get_Property(ConnectivityChecksProject binary_dir) | |
500 | |
501 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
502 if (MSVC) | |
503 set(Prefix "") | |
504 else() | |
505 set(Prefix "lib") # MinGW | |
506 endif() | |
507 | |
508 install(FILES | |
509 ${binary_dir}/${Prefix}OrthancChecks.dll | |
510 DESTINATION "lib") | |
511 else() | |
512 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
513 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
514 install(FILES | |
515 ${binary_dir}/${Prefix}OrthancChecks${Suffix} | |
516 ${binary_dir}/${Prefix}OrthancChecks${Suffix}.${ORTHANC_VERSION} | |
517 DESTINATION "share/orthanc/plugins") | |
518 endif() | |
519 endif() | |
520 | |
521 | |
522 | |
523 ##################################################################### | |
464 ## Build the companion tool to recover files compressed using Orthanc | 524 ## Build the companion tool to recover files compressed using Orthanc |
465 ##################################################################### | 525 ##################################################################### |
466 | 526 |
467 if (BUILD_RECOVER_COMPRESSED_FILE) | 527 if (BUILD_RECOVER_COMPRESSED_FILE) |
468 set(RECOVER_COMPRESSED_SOURCES | 528 set(RECOVER_COMPRESSED_SOURCES |