
# 如果是Macos
if (APPLE)
    # 获取 Homebrew 安装的 libomp 路径
    execute_process(
            COMMAND brew --prefix libomp
            OUTPUT_VARIABLE HOMEBREW_LIBOMP_PATH
            OUTPUT_STRIP_TRAILING_WHITESPACE
    )

    # 设置 OpenMP 路径变量
    set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${HOMEBREW_LIBOMP_PATH}/include")
    set(OpenMP_CXX_LIB_NAMES "omp")
    set(OpenMP_omp_LIBRARY "${HOMEBREW_LIBOMP_PATH}/lib/libomp.dylib")
    enable_language(OBJC OBJCXX)
endif ()
