You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dependency_graphengine.cmake 1.7 kB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. message(STATUS "Compiling GraphEngine")
  2. set(GE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/graphengine)
  3. message(STATUS "[ME] build_path: ${BUILD_PATH}")
  4. function(find_submodule_lib module name path)
  5. find_library(${module}_LIBRARY_DIR NAMES ${name} NAMES_PER_DIR PATHS ${path}
  6. PATH_SUFFIXES lib
  7. )
  8. if("${${module}_LIBRARY_DIR}" STREQUAL "${module}_LIBRARY_DIR-NOTFOUND")
  9. message(FATAL_ERROR "${name} not found in any of following paths: ${path}")
  10. endif()
  11. add_library(${module} SHARED IMPORTED)
  12. set_target_properties(${module} PROPERTIES
  13. IMPORTED_LOCATION ${${module}_LIBRARY_DIR}
  14. )
  15. endfunction()
  16. if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
  17. set(_ge_tmp_CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
  18. set(_ge_tmp_ENABLE_GITEE ${ENABLE_GITEE})
  19. set(ENABLE_GITEE ON)
  20. set(CMAKE_INSTALL_PREFIX ${BUILD_PATH}/graphengine)
  21. if(ENABLE_TESTCASES)
  22. # use slog, error manager, mmpa in non ascend mode, e.g. tests
  23. set(GE_PREBUILD_PATH ${GE_SOURCE_DIR}/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR})
  24. set(ENABLE_MS_TESTCASES TRUE)
  25. find_submodule_lib(slog libalog.so ${GE_PREBUILD_PATH})
  26. find_submodule_lib(error_manager liberror_manager.so ${GE_PREBUILD_PATH})
  27. find_submodule_lib(static_mmpa libmmpa.a ${GE_PREBUILD_PATH})
  28. endif()
  29. string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  30. add_subdirectory(${GE_SOURCE_DIR})
  31. set(CMAKE_INSTALL_PREFIX ${_ge_tmp_CMAKE_INSTALL_PREFIX})
  32. set(ENABLE_GITEE ${_ge_tmp_ENABLE_GITEE})
  33. else()
  34. message(FATAL_ERROR "No compile option defined for GraphEngine, exiting")
  35. endif()