view Resources/CMake/PlustacheConfiguration.cmake @ 1033:b24954e7ebfa Orthanc-0.8.0

Orthanc-0.8.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jul 2014 15:54:51 +0200
parents a93867a94011
children 3a26bc6e4867
line wrap: on
line source

if (USE_PLUSTACHE)
  add_definitions(-DORTHANC_PLUSTACHE_ENABLED=1)

  if (STATIC_BUILD OR NOT USE_SYSTEM_PLUSTACHE)
    set(PLUSTACHE_SOURCES_DIR ${CMAKE_BINARY_DIR}/plustache-0.3.0)
    DownloadPackage(
      "6162946bdb3dccf3b2185fcf149671ee"
      "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/plustache-0.3.0.tar.gz"
      "${PLUSTACHE_SOURCES_DIR}")

    list(APPEND THIRD_PARTY_SOURCES
      ${PLUSTACHE_SOURCES_DIR}/src/context.cpp
      ${PLUSTACHE_SOURCES_DIR}/src/template.cpp
      )

    include_directories(
      ${PLUSTACHE_SOURCES_DIR}
      )

    execute_process(
      COMMAND patch -p0 -i ${CMAKE_SOURCE_DIR}/Resources/CMake/PlustacheConfiguration.patch
      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
      )

    source_group(ThirdParty\\Plustache REGULAR_EXPRESSION ${PLUSTACHE_SOURCES_DIR}/.*)

  else()
    message(FATAL_ERROR "Dynamic linking against plustache not implemented (a patch is required)")
  endif()

else()
  add_definitions(-DORTHANC_PLUSTACHE_ENABLED=0)

endif()