代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/QPanda-2-0 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#.rst:
# FindQPANDA
# --------
#
# Find qpanda
#
# Find the native qpanda headers and libraries.
#
# ::
#
# QPANDA_INCLUDE_DIR - QPanda-2 include etc.
# THIRD_INCLUDE_DIR - ThirdParty include
# QPANDA_LIBRARIES - List of libraries when using QPanda.
# QALG_LIBRARY - QAlg library
# COMPONENTS_LIBRARY - Variational library
# TINY_LIBRARY - TinyXML library
# ANTLR4_LIBRARY - antlr4 library
# QPANDA_LIBRARY - QPanda-2 library
# QPANDA_FOUND - True if curl found.
#
# Look for the header file.
find_path(QPANDA_INCLUDE_DIR NAMES qpanda2/QPanda.h qpanda2/QPandaVersion.h
PATHS
${QPANDA_INSTALL_DIR}/include)
set(QPANDA_INCLUDE_DIR "${QPANDA_INCLUDE_DIR}/qpanda2/")
find_path(THIRD_INCLUDE_DIR NAMES qpanda2/ThirdParty/TinyXML/tinyxml.h
PATHS
${QPANDA_INSTALL_DIR}/include)
include_directories(${THIRD_INCLUDE_DIR}/qpanda2/ThirdParty)
mark_as_advanced(QPANDA_INCLUDE_DIR)
# Look for the library (sorted from most current/relevant entry to least).
find_library(QALG_LIBRARY NAMES QAlg
PATHS
${QPANDA_INSTALL_DIR}/lib)
find_library(QPANDA_LIBRARY NAMES QPanda2
PATHS
${QPANDA_INSTALL_DIR}/lib)
find_library(COMPONENTS_LIBRARY NAMES Components
PATHS
${QPANDA_INSTALL_DIR}/lib)
find_library(TINY_LIBRARY NAMES TinyXML
PATHS
${QPANDA_INSTALL_DIR}/lib)
find_library(ANTLR4_LIBRARY NAMES antlr4
PATHS
${QPANDA_INSTALL_DIR}/lib)
find_library(GPUBACKEND_LIBRARY NAMES GPUQGates
PATHS
${QPANDA_INSTALL_DIR}/lib)
mark_as_advanced(QPANDA_LIBRARY)
mark_as_advanced(QALG_LIBRARY)
mark_as_advanced(COMPONENTS_LIBRARY)
mark_as_advanced(TINY_LIBRARY)
mark_as_advanced(ANTLR4_LIBRARY)
set(QPANDA_LIBRARIES)
list(APPEND QPANDA_LIBRARIES
${QPANDA_LIBRARY}
${QALG_LIBRARY}
${COMPONENTS_LIBRARY}
${TINY_LIBRARY}
${ANTLR4_LIBRARY})
if (GPUBACKEND_LIBRARY)
find_package(CUDA)
include_directories(${CUDA_INCLUDE_DIRS})
mark_as_advanced(GPUBACKEND_LIBRARY)
list(APPEND QPANDA_LIBRARIES
${GPUBACKEND_LIBRARY}
${CUDA_LIBRARIES})
endif()
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif(OPENMP_FOUND)
if(QPANDA_INCLUDE_DIR AND QPANDA_LIBRARY)
set(QPANDA_FOUND TRUE)
mark_as_advanced(QPANDA_LIBRARIES)
if(QPANDA_INCLUDE_DIR AND NOT QPANDA_VERSION_STRING)
foreach(_qpanda_version_header QPandaVersion.h)
if(EXISTS "${QPANDA_INCLUDE_DIR}/${_qpanda_version_header}")
file(READ "${QPANDA_INCLUDE_DIR}/${_qpanda_version_header}" QPANDA_VERSION_H_CONTENTS)
string(REGEX MATCH "#define QPANDA_MAJOR_VERSION [0-9]+"
QPANDA_MAJOR_VERSION ${QPANDA_VERSION_H_CONTENTS})
string(REGEX REPLACE "[^0-9]" "" QPANDA_MAJOR_VERSION ${QPANDA_MAJOR_VERSION})
string(REGEX MATCH "#define QPANDA_MINOR_VERSION [0-9]+"
QPANDA_MINOR_VERSION ${QPANDA_VERSION_H_CONTENTS})
string(REGEX REPLACE "[^0-9]" "" QPANDA_MINOR_VERSION ${QPANDA_MINOR_VERSION})
string(REGEX MATCH "#define QPANDA_PATCH_VERSION [0-9]+"
QPANDA_PATCH_VERSION ${QPANDA_VERSION_H_CONTENTS})
string(REGEX REPLACE "[^0-9]" "" QPANDA_PATCH_VERSION ${QPANDA_PATCH_VERSION})
set(QPANDA_VERSION_STR "${QPANDA_MAJOR_VERSION}.${QPANDA_MINOR_VERSION}.${QPANDA_PATCH_VERSION}")
unset(qpanda_version_str)
break()
endif()
endforeach()
endif()
else(QPANDA_INCLUDE_DIR AND QPANDA_LIBRARY)
message("QPANDA Not Find")
endif(QPANDA_INCLUDE_DIR AND QPANDA_LIBRARY)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(QPANDA
REQUIRED_VARS QPANDA_LIBRARY QPANDA_INCLUDE_DIR
VERSION_VAR QPANDA_VERSION_STR
HANDLE_COMPONENTS)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。