File: FindAtlas.cmake

package info (click to toggle)
cp2k 2025.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 372,060 kB
  • sloc: fortran: 963,262; ansic: 64,495; f90: 21,676; python: 14,419; sh: 11,382; xml: 2,173; makefile: 996; pascal: 845; perl: 492; cpp: 345; lisp: 297; csh: 16
file content (37 lines) | stat: -rw-r--r-- 1,660 bytes parent folder | download | duplicates (3)
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
#!-------------------------------------------------------------------------------------------------!
#!   CP2K: A general program to perform molecular dynamics simulations                             !
#!   Copyright 2000-2025 CP2K developers group <https://cp2k.org>                                  !
#!                                                                                                 !
#!   SPDX-License-Identifier: GPL-2.0-or-later                                                     !
#!-------------------------------------------------------------------------------------------------!

# Copyright (c) 2022- ETH Zurich
#
# authors : Mathieu Taillefumier

include(FindPackageHandleStandardArgs)
include(cp2k_utils)

cp2k_set_default_paths(ATLAS "Atlas")

cp2k_find_libraries(ATLAS "atlas")
cp2k_include_dirs(FFTW3 "cblas.h atlas/cblas.h")
# check if found
find_package_handle_standard_args(Atlas REQUIRED_VARS CP2K_ATLAS_INCLUDE_DIRS
                                                      CP2K_ATLAS_LINK_LIBRARIES)

# add target to link against
if(CP2K_ATLAS_FOUND AND NOT TARGET CP2K_ATLAS::atlas)
  if(NOT TARGET cp2k::BLAS::ATLAS::atlas)
    add_library(cp2k::BLAS::ATLAS::atlas INTERFACE IMPORTED)
  endif()
  set_property(TARGET cp2k::BLAS::ATLAS::atlas
               PROPERTY INTERFACE_LINK_LIBRARIES ${CP2K_ATLAS_LINK_LIBRARIES})
  set_property(
    TARGET cp2k::BLAS::ATLAS::atlas PROPERTY INTERFACE_INCLUDE_DIRECTORIES
                                             ${CP2K_ATLAS_INCLUDE_DIRS})
endif()

# prevent clutter in cache
mark_as_advanced(CP2K_ATLAS_FOUND CP2K_ATLAS_LINK_LIBRARIES
                 CP2K_ATLAS_INCLUDE_DIRS)