cmake

OpenCV 3.0 undefined reference error?

删除回忆录丶 提交于 2020-08-01 06:17:06
问题 I've just followed the instructions to install opencv 3 on my ubuntu computer (I've already installed and ran programs using opencv 3 on a different linux device), however, when I tried to run one of my test programs from my old computer I get the following errors: CMakeFiles/VideoTest.dir/VideoTest.cpp.o: In function `main': VideoTest.cpp:(.text+0x6f): undefined reference to `cv::VideoWriter::fourcc(char,char,char, char)' VideoTest.cpp:(.text+0xc3): undefined reference to `cv::VideoWriter:

What does enable_testing() do in cmake?

余生长醉 提交于 2020-07-31 07:15:36
问题 I see that to add my google tests(for my cpp project), I need to make a call to enable_testing() in the root source directory. Can someone explain what this really does? Also why would cmake not make this default? This is all I could get from the documentation. Enables testing for this directory and below. See also the add_test() command. Note that ctest expects to find a test file in the build directory root. Therefore, this command should be in the source directory root. 回答1: When you call

Use ImageWand component of ImageMagick lib with CMake

こ雲淡風輕ζ 提交于 2020-07-31 04:18:28
问题 I'm programming in C. I want use ImageMagick library but some fuction can't be resolved. This is my cMakeList.txt file: cmake_minimum_required(VERSION 3.3) project(WebServer) set(CMAKE_C_COMPILER "/usr/bin/gcc") set(SOURCE_FILES io.c server.c lock_fcntl.c sig_handler.c thread_job.c msg_parser.c) set(LIB http-parser-master/http_parser.c ) set(CMAKE_USE_PTHREADS_INIT true) set(CMAKE_USE_PTHREADS_INIT ON) find_package(Threads REQUIRED) find_package(ImageMagick COMPONENTS ImageWand) include

Does the “@” symbol have a special meaning when surrounding a CMake variable?

别说谁变了你拦得住时间么 提交于 2020-07-30 07:26:46
问题 While looking through the ITK source code I've come across a number of files like this, which have the suffix .cmake.in and which define a number of variables (strings?), where the value is identical to the variable name, but with @ symbols prepended/appended. For example: set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@") What is the purpose of these declarations? Does the @ symbol have a special meaning in this context? I tried searching for this in the CMake Language Syntax

Does the “@” symbol have a special meaning when surrounding a CMake variable?

↘锁芯ラ 提交于 2020-07-30 07:26:32
问题 While looking through the ITK source code I've come across a number of files like this, which have the suffix .cmake.in and which define a number of variables (strings?), where the value is identical to the variable name, but with @ symbols prepended/appended. For example: set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@") What is the purpose of these declarations? Does the @ symbol have a special meaning in this context? I tried searching for this in the CMake Language Syntax

protobuf 安装笔记

送分小仙女□ 提交于 2020-07-29 10:53:20
#if GOOGLE_PROTOBUF_VERSION < 3000000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #endif #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #endif java用的: https://github.com/CodeBhushan/FreeLancing https://github.com/chai2010/protorpc3-cxx Install CMake and MSVC(Windows) or MinGW(Windows) or gcc(Unix) cd ${protorpc_root} and build with cmake protobuf xls2protobuf 不是c++用的

安装 SeaFile 客户端

时光怂恿深爱的人放手 提交于 2020-07-29 06:32:20
操作系统:优麒麟 Ubuntu Kylin 20.04 LTS 适用架构:AMD64、ARM64(鲲鹏、飞腾) 方法1、从优麒麟官方的软件仓库安装 sudo apt install seafile-gui 方法2、自行编译 下载源代码 https://github.com/haiwen/seafile-client/releases 安装一些依赖 一次性全部安装 sudo apt install cmake gcc g++ qt5-default qt5-qmake qttools5-dev qttools5-dev-tools sqlite3 libsqlite3-dev libjansson-dev libsearpc-dev libseafile-dev libevent-dev doxygen-gui graphviz libssl-dev 分步骤安装依赖 sudo apt install cmake sudo apt install gcc g++ 查看版本:gcc --version,g++ --version。 sudo apt install qt5-default qt5-qmake qttools5-dev qttools5-dev-tools 查看版本:qmake --version。版本Qt >= 5.5 sudo apt install sqlite3

Ubuntu 16.04 中安装 cmake 3.17.0

偶尔善良 提交于 2020-07-29 05:53:38
前言 在对 SLAM 学习的过程中,有可能遇到 cmake 版本过低而报错的问题,这里教大家如何简单快速的在 Ubuntu 上安装新版 cmake。 运行环境 Windows 10 VMware Workstation Pro Ubuntu 16.04 LTS cmake 3.17.0 第一种方法是使用命令 sudo apt install cmake ,这种方法是直接从镜像源中查找软件包,往往不是最新的,因此在使用一些较新的软件时总会报错。 第二种方法是直接在官网下载最新的安装包,在终端命令行中进行安装。我们主要讲解这种方法。 首先,我们在 cmake 官网 下载 cmake 3.17,选择 cmake-3.17.0-Linux-x86_64.tar.gz。可以直接使用命令 sudo wget https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz 或直接下载在 Windows 中,然后拖到 Ubuntu 的桌面。因为在我的环境下 Windows 迅雷下载较快,所以选择了直接拖动。关于如何实现拖动,见 在 Windows 和 Ubuntu 间拖动文件 。 下载完安装包后,使用命令 tar -zvxf cmake-3.17.0-Linux-x86_64.tar.gz 解压,得到文件夹 cmake-3.17.0

std::unique_ptr release的使用

梦想与她 提交于 2020-07-28 09:35:10
在c++中,动态内存管理是通过new/delete 运算符来进行的。由于确保在正确的时间释放内存是很困难的,为了避免内存泄漏,更加容易,安全地使用动态内存,C++11标准库提供了两种智能指针类型来管理动态对象。只能指针的行为类似于常规指针,重要的区别是它负责自动释放所指的对象。 std::shared_ptr , 允许多个指针指向同一个对象 std::unique_ptr, 独占所指向的对象 std::unique_ptr 是 c++11中用来取代 std::auto_ptr 指针的指针容器。 它不能与其他unique_ptr类型的指针对象共享所指对象的内存。这种所有权仅能够通过std::move函数来转移。unique_ptr是一个删除了拷贝构造函数、保留了移动构造函数的指针封装类型。 调用release 会切断unique_ptr 和它原来管理的对象的联系。release 返回的指针通常被用来初始化另一个智能指针或给另一个智能指针赋值。如果不用另一个智能指针来保存release返回的指针,程序就要负责资源的释放。 #include <iostream> #include <memory> int main() { std::unique_ptr < int > uptr( new int ( 10 )); // 绑定动态对象 // std::unique_ptr<int>

Replace ctest command with “ctest --output-on-failure” permanently for a specific project in CMakeLists.txt

雨燕双飞 提交于 2020-07-26 16:59:58
问题 I have found that generic ctest command doesn't give much information about the tests, so I would like to add ctest --output-on-failure but not have the users to worry about the flag. I want them just to cmake , make the project and run ctest and it should run ctest with the --output-on-failure flag. Is it possible to do that in CMakeLists.txt? EDIT: Output of env CTEST_OUTPUT_ON_FAILURE=1 make test 4/13 Test #4: TEST_SSSP ........................***Failed Required regular expression not