-
Notifications
You must be signed in to change notification settings - Fork 1k
/
mlx.pc.in
52 lines (44 loc) · 1.66 KB
/
mlx.pc.in
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
46
47
48
49
50
51
52
# Find MLX
#
# Defines the following variables:
#
# MLX_FOUND : True if MLX is found
# MLX_INCLUDE_DIRS : Include directory
# MLX_LIBRARIES : Libraries to link against
# MLX_CXX_FLAGS : Additional compiler flags
# MLX_BUILD_ACCELERATE : True if MLX was built with accelerate
# MLX_BUILD_METAL : True if MLX was built with metal
@PACKAGE_INIT@
include(@PACKAGE_MLX_CMAKE_INSTALL_MODULE_DIR@/MLXTargets.cmake)
include(@PACKAGE_MLX_CMAKE_INSTALL_MODULE_DIR@/extension.cmake)
set_and_check(MLX_LIBRARY_DIRS @PACKAGE_CMAKE_INSTALL_LIBDIR@)
set_and_check(MLX_INCLUDE_DIRS @PACKAGE_CMAKE_INSTALL_INCLUDEDIR@)
set(MLX_LIBRARIES mlx)
find_library(MLX_LIBRARY mlx PATHS ${MLX_LIBRARY_DIRS})
if (@MLX_BUILD_ACCELERATE@)
set(MLX_BUILD_ACCELERATE @MLX_BUILD_ACCELERATE@)
set(MLX_CXX_FLAGS ${MLX_CXX_FLAGS} -DACCELERATE_NEW_LAPACK)
endif()
if (@MLX_BUILD_METAL@)
set(MLX_BUILD_METAL @MLX_BUILD_METAL@)
set(MLX_CXX_FLAGS ${MLX_CXX_FLAGS} -D_METAL_)
set(MLX_INCLUDE_DIRS
"${MLX_INCLUDE_DIRS};"
@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/metal_cpp
)
if(@MLX_METAL_VERSION@ GREATER_EQUAL 310)
set(MLX_INCLUDE_DIRS
"${MLX_INCLUDE_DIRS};"
@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/mlx/backend/metal/kernels/metal_3_1)
else()
set(MLX_INCLUDE_DIRS
"${MLX_INCLUDE_DIRS};"
@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/mlx/backend/metal/kernels/metal_3_0)
endif()
endif()
set_target_properties(mlx PROPERTIES
CXX_STANDARD 17
INTERFACE_COMPILE_OPTIONS "${MLX_CXX_FLAGS}"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MLX DEFAULT_MSG MLX_LIBRARY MLX_INCLUDE_DIRS)