cmake

在Ubuntu18.04上安装opencv 3.4.1

﹥>﹥吖頭↗ 提交于 2021-02-13 01:57:25
对于安装opencv有的人一次就成功,而有人安装了N多次才成功。我就是那个安装了N多次的人,每次遇到了很多安装错误,只能通过到网上搜教程资料,解决方法;通过一次次的试错,最终完成了安装。再此提醒第一次安装或则安装失败没有头绪的小伙伴,请注重官方安装教程: https://docs.opencv.org/master/d9/df8/tutorial_root.html 安装环境是:ubuntu 18.04 安装的opencv版本为3.4.1(其他版本也行,安装过程类似) opencv安装的依赖包有: Required Packages GCC 4.4.x or later CMake 2.8.7 or higher Git GTK+2.x or higher, including headers (libgtk2.0-dev) pkg-config Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy) ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev [optional] libtbb2 libtbb-dev [optional]

Ubuntu18.04 安装 OpenCV 4.1.1

梦想的初衷 提交于 2021-02-13 01:42:21
1. 安装依赖包 sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev # 处理图像所需的包 sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev sudo apt-get install libxvidcore-dev libx264-dev # 处理视频所需的包 sudo apt-get install libatlas-base-dev gfortran # 优化opencv功能 sudo apt-get install ffmpeg 出现下面错误 errorE: unable to locate libjasper-dev 就运行下面命令 sudo apt-get

CMake incorrectly identifying valid C++ compiler options?

戏子无情 提交于 2021-02-11 18:16:48
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

CMake incorrectly identifying valid C++ compiler options?

柔情痞子 提交于 2021-02-11 18:07:30
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable

How do I configure my CMake project to run all unit tests?

六眼飞鱼酱① 提交于 2021-02-11 17:49:17
问题 I have a C++ project using cmake as the build tool. My directory structure looks like the following. . ├── cmake-build-debug ├── include ├── src └── tests When I am inside cmake-build-debug , I run cmake .. followed by make clean && make && make test . What I noticed is that only the first unit test is run. How do I configure my project so that when I run make test , all unit tests are run? At the root, my CMakeLists.txt looks like the following. cmake_minimum_required(VERSION 3.10) project

CMake: Howto test for compiler, before enable a language

一曲冷凌霜 提交于 2021-02-11 17:20:06
问题 In my project some code can be optional compiled in a different language (nasm & fortran), but it's also fine to compile the project without having these compiler installed. E.g. on Windows. I would like to check if the the compiler are installed, before enabling the languages with enable_language enable_language(ASM_NASM) enable_language(Fortran) If I use enable_language without an additional check, CMake stops with an error message. (At the moment I check for if (MSVC) as workaround.) Btw.

Local install Eigen in CMAKE not finding target

梦想的初衷 提交于 2021-02-11 15:14:12
问题 I'm trying to build and use a local version of Eigen that I've downloaded directly from the CMake file of my project. I have those line to build it: include(FetchContent) FetchContent_Declare( eigen URL ${CMAKE_CURRENT_SOURCE_DIR}/external/eigen-3.3.8.tar.gz ) FetchContent_MakeAvailable(eigen) set(EIGEN3_INCLUDE_DIR ${eigen_SOURCE_DIR}) But then I got errors like Target "XXX_LIBRARIES" links to target "Eigen3::Eigen" but the target was not found. Perhaps a find_package() call is missing for

How to make Cmake find tesseract library in Windows (Findtesseract.cmake)?

微笑、不失礼 提交于 2021-02-11 14:31:22
问题 I installed, in Windows, Tesseract, using "Windows Installer made with MinGW-w64 from UB Mannheim" from here, and added to my CMakeLists.txt: find_package(Tesseract REQUIRED) but I get CMake Error at CMakeLists.txt:14 (find_package): By not providing "FindTesseract.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Tesseract", but CMake did not find one. Could not find a package configuration file provided by "Tesseract" (requested

cMakefile for using tesseract and opencv

别等时光非礼了梦想. 提交于 2021-02-11 14:28:12
问题 I am a newbie to cmake and I am writing an application for using tesseract. the g++ command line work fine g++ -O3 -std=c++11 `pkg-config --cflags --libs tesseract opencv` my_first.cpp -o my_first But I wrote the following CMakeFile.txt and building in Clion and it throws a bunch of linking errors cmake_minimum_required(VERSION 2.6) add_compile_options(-std=c++11) project (my_first) find_package(PkgConfig REQUIRED) pkg_check_modules (OPENCV REQUIRED opencv) link_directories(${OPENCV_LIBRARY

how to use jenkins to build 32 bit and 64 bit program and sealed in one package

南楼画角 提交于 2021-02-11 14:27:54
问题 it is another time to seek help from stack overflow . I am trying to use jenkins , My aim is to build a windows install package that contains 32bit and 64bit version. My prior manual routine is : built the 32bit and 64bit separately , and use innoSetup to build the package containing 2 versions. if use jenkins ,the procedure will be : a linux jenkins server(master) send a build request to windowns jenkins server(agent) agent checkout code from svn built the package with 2 versions I guess the