Mercurial > hg > orthanc-wsi
comparison Resources/Orthanc/DownloadOrthancFramework.cmake @ 196:b0bd22077cd8
sharing code with orthanc-stone
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 01 Jul 2020 17:57:38 +0200 |
parents | e57e6ca5303d |
children |
comparison
equal
deleted
inserted
replaced
195:fda17c92d784 | 196:b0bd22077cd8 |
---|---|
503 /usr/include/orthanc-framework | 503 /usr/include/orthanc-framework |
504 /usr/local/include/orthanc-framework | 504 /usr/local/include/orthanc-framework |
505 ${ORTHANC_FRAMEWORK_ROOT} | 505 ${ORTHANC_FRAMEWORK_ROOT} |
506 ) | 506 ) |
507 endif() | 507 endif() |
508 | |
509 if (${ORTHANC_FRAMEWORK_INCLUDE_DIR} STREQUAL "ORTHANC_FRAMEWORK_INCLUDE_DIR-NOTFOUND") | |
510 message(FATAL_ERROR "Cannot locate the OrthancFramework.h header") | |
511 endif() | |
508 | 512 |
509 message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") | 513 message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") |
510 include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) | 514 include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) |
511 | 515 |
516 if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") | |
517 set(ORTHANC_FRAMEWORK_LIBRARIES OrthancFramework) | |
518 else() | |
519 if (MSVC) | |
520 set(Suffix ".lib") | |
521 set(Prefix "") | |
522 else() | |
523 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
524 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
525 endif() | |
526 set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix}) | |
527 endif() | |
528 | |
512 set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") | 529 set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") |
513 | 530 set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}") |
514 if (NOT "${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") | |
515 set(CMAKE_REQUIRED_LIBRARIES "-L${ORTHANC_FRAMEWORK_LIBDIR} -lOrthancFramework") | |
516 else() | |
517 set(CMAKE_REQUIRED_LIBRARIES "OrthancFramework") | |
518 endif() | |
519 | 531 |
520 check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) | 532 check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) |
521 if(NOT HAVE_ORTHANC_FRAMEWORK) | 533 if (NOT HAVE_ORTHANC_FRAMEWORK) |
522 message(FATAL_ERROR "Cannot find the Orthanc framework") | 534 message(FATAL_ERROR "Cannot find the Orthanc framework") |
523 endif() | 535 endif() |
524 | 536 |
525 if (NOT "${ORTHANC_FRAMEWORK_ROOT}" STREQUAL "") | 537 if (NOT "${ORTHANC_FRAMEWORK_ROOT}" STREQUAL "") |
526 include_directories(${ORTHANC_FRAMEWORK_ROOT}) | 538 include_directories(${ORTHANC_FRAMEWORK_ROOT}) |
527 endif() | 539 endif() |
528 | 540 endif() |
529 if (NOT "${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") | |
530 link_directories(${ORTHANC_FRAMEWORK_LIBDIR}) | |
531 endif() | |
532 endif() |