aclrt.cmake 960 字节
Newer Older
1 2 3 4 5 6 7
find_library(
  ACLRT_LIBRARY
  NAMES libascendcl.so
  PATHS ${ALTER_LD_LIBRARY_PATHS} "$ENV{ACLRT_HOME}/lib64/stub" ${CMAKE_INSTALL_PREFIX}
  HINTS ${ALTER_LIBRARY_PATHS}
  PATH_SUFFIXES stub
  DOC "ACL library.")
8 9

if(ACLRT_LIBRARY STREQUAL "ACLRT_LIBRARY-NOTFOUND")
10
  message(FATAL_ERROR "Can not find ACLRT Library")
11 12 13
endif()

get_filename_component(__found_aclrt_root "${ACLRT_LIBRARY}/../../../" REALPATH)
14 15 16 17 18 19
find_path(
  ACLRT_INCLUDE_DIR
  NAMES acl/acl.h
  HINTS "$ENV{ACLRT_HOME}/include" ${__found_aclrt_root}
  PATH_SUFFIXES include
  DOC "Path to ACLRT include directory.")
20 21

if(ACLRT_INCLUDE_DIR STREQUAL "ACLRT_INCLUDE_DIR-NOTFOUND")
22
  message(FATAL_ERROR "Can not find ACLRT Library")
23 24 25 26
endif()

add_library(libascendcl SHARED IMPORTED)

27 28 29
set_target_properties(
  libascendcl PROPERTIES IMPORTED_LOCATION ${ACLRT_LIBRARY}
                         INTERFACE_INCLUDE_DIRECTORIES ${ACLRT_INCLUDE_DIR})
30

31
message(STATUS "Found ACLRT: ${__found_aclrt_root}")