-
Notifications
You must be signed in to change notification settings - Fork 254
/
FindoneCCL.cmake
36 lines (29 loc) · 989 Bytes
/
FindoneCCL.cmake
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
# - Try to find oneCCL
#
# The following are set after configuration is done:
# ONECCL_FOUND : set to true if oneCCL is found.
# ONECCL_INCLUDE_DIRS : path to oneCCL include dir.
# ONECCL_LIBRARIES : list of libraries for oneCCL
#
# and the following imported targets:
#
# oneCCL
IF (NOT ONECCL_FOUND)
SET(ONECCL_FOUND OFF)
SET(ONECCL_LIBRARIES)
SET(ONECCL_INCLUDE_DIRS)
SET(ONECCL_ROOT "${PROJECT_SOURCE_DIR}/third_party/oneCCL")
IF(BUILD_NO_ONECCL_PACKAGE)
ADD_SUBDIRECTORY(${ONECCL_ROOT} oneCCL EXCLUDE_FROM_ALL)
ELSE()
ADD_SUBDIRECTORY(${ONECCL_ROOT} build)
ENDIF()
IF(NOT TARGET ccl)
MESSAGE(FATAL_ERROR "Failed to find oneCCL target")
ENDIF()
add_library(oneCCL ALIAS ccl)
GET_TARGET_PROPERTY(INCLUDE_DIRS oneCCL INCLUDE_DIRECTORIES)
SET(ONECCL_INCLUDE_DIRS ${INCLUDE_DIRS})
SET(ONECCL_LIBRARIES oneCCL)
find_package_handle_standard_args(oneCCL FOUND_VAR ONECCL_FOUND REQUIRED_VARS ONECCL_LIBRARIES ONECCL_INCLUDE_DIRS)
ENDIF(NOT ONECCL_FOUND)