summaryrefslogtreecommitdiff
path: root/infra/cmake/packages/NoniusSourceConfig.cmake
blob: 17965f1ebed9dc82bf340ef31b711bcf30003434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function(_NoniusSource_import)
  if(NOT ${DOWNLOAD_NONIUS})
    set(NoniusSource_FOUND FALSE PARENT_SCOPE)
    return()
  endif(NOT ${DOWNLOAD_NONIUS})

  nnas_include(ExternalSourceTools)
  nnas_include(OptionTools)

  envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com")
  set(NONIUS_URL ${EXTERNAL_DOWNLOAD_SERVER}/libnonius/nonius/archive/v1.2.0-beta.1.tar.gz)
  ExternalSource_Download("NONIUS" ${NONIUS_URL})

  if(BUILD_KBENCHMARK)
    # Copy html_report_template.g.h++ file to externals/nonius.
    # This header file is modified to show the html summary view according to the layer in kbenchmark.
    execute_process(COMMAND ${CMAKE_COMMAND} -E copy
                    "${CMAKE_CURRENT_LIST_DIR}/Nonius/html_report_template.g.h++"
                    "${NoniusSource_DIR}/include/nonius/detail")
  endif(BUILD_KBENCHMARK)

  set(NoniusSource_DIR ${NONIUS_SOURCE_DIR} PARENT_SCOPE)
  set(NoniusSource_FOUND TRUE PARENT_SCOPE)
endfunction(_NoniusSource_import)

_NoniusSource_import()