File: GridToolsConfig.cmake.in

package info (click to toggle)
gridtools 2.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,480 kB
  • sloc: cpp: 228,792; python: 17,561; javascript: 9,164; ansic: 4,101; sh: 850; makefile: 231; f90: 201
file content (45 lines) | stat: -rw-r--r-- 1,617 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#[=======================================================================[.rst:

GridToolsConfig
---------------

In case the compiler is Clang targeting CUDA, set ``GT_CLANG_CUDA_MODE`` to
``AUTO`` (default), ``Clang-CUDA`` or ``NVCC-CUDA``. ``AUTO`` will use
``Clang-CUDA`` if available.

Targets
^^^^^^^^^^^^^^^^

Depending on the available dependencies (OpenMP, MPI, CUDA) a set of targets is
exported. A configuration summary will be printed in case of successfully
detecting GridTools.

#]=======================================================================]

set(GridTools_VERSION @GridTools_VERSION@)

@PACKAGE_INIT@

get_filename_component(GRIDTOOLS_CONFIG_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

# Only setup targets, if GridTools was not already included with a add_subdirectory/FetchContent
if(NOT @PROJECT_NAME@_BINARY_DIR AND NOT TARGET GridTools::gridtools)
    include("${GRIDTOOLS_CONFIG_CMAKE_DIR}/GridToolsTargets.cmake" )

    list(APPEND CMAKE_MODULE_PATH @PACKAGE_GRIDTOOLS_MODULE_PATH@)
    include(gridtools_setup_targets)

    if(NOT DEFINED GT_CLANG_CUDA_MODE)
        set(GT_CLANG_CUDA_MODE AUTO)
    endif()
    _gt_setup_targets(TRUE ${GT_CLANG_CUDA_MODE})
else()
    message(WARNING "find_package(GridTools) ignored, targets are already available.")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GridTools REQUIRED_VARS GridTools_VERSION VERSION_VAR GridTools_VERSION)
if(GridTools_FOUND)
    find_package_message(GridTools "  at ${GRIDTOOLS_CONFIG_CMAKE_DIR}" "[${GRIDTOOLS_CONFIG_CMAKE_DIR}]")
    _gt_print_configuration_summary()
endif()