代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.8)
project(MultiX LANGUAGES CXX)
# indicate if OPENMP should be enabled
option(USE_OPENMP "Use OPENMP" ON)
# indicate if the sample project should be included
option(CREATE_SAMPLE_PROJECT "Create the Sample Project" ON)
# ==============================================================================
# Check C++17 support
# ==============================================================================
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# ==============================================================================
# Find OpenCV
# ==============================================================================
find_package(OpenCV 3.0 REQUIRED)
# ==============================================================================
# Find OpenMP
# ==============================================================================
find_package(OpenMP)
if (USE_OPENMP)
if(NOT OPENMP_FOUND)
message(FATAL_ERROR "OPENMP not found.")
endif()
add_definitions(-DUSE_OPENMP)
set(TRGT_LNK_LBS_ADDITIONAL OpenMP::OpenMP_CXX)
endif (USE_OPENMP)
# ==============================================================================
# Includes
# ==============================================================================
include_directories (
${PROJECT_SOURCE_DIR}/include
)
# ==============================================================================
# Structure: Multi-X Library
# ==============================================================================
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
# Set header files for the library
file(GLOB_RECURSE HDRS_MULTIX
"include/*.h"
)
# Set source files to be added to the library
file(GLOB_RECURSE SRCS_MULTIX
"include/*.cpp"
)
add_library(${PROJECT_NAME} STATIC
${HDRS_MULTIX}
${SRCS_MULTIX}
)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries (${PROJECT_NAME}
${OpenCV_LIBS})
# ==============================================================================
# Structure: Applications
# ==============================================================================
if (CREATE_SAMPLE_PROJECT)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
add_executable(SampleProject
src/main.cpp)
target_link_libraries(SampleProject
${PROJECT_NAME}
${OpenCV_LIBS}
)
add_dependencies(SampleProject ${PROJECT_NAME})
endif (CREATE_SAMPLE_PROJECT)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。