cmake

How to use c++20 modules with CMake?

≯℡__Kan透↙ 提交于 2020-12-25 01:41:17
问题 Clang and MSVC already supports Modules TS from unfinished C++20 standard. Can I build my modules based project with CMake or other build system and how? I tried build2, it supports modules and it works very well, but i have a question about it's dependency management (UPD: question is closed). 回答1: This works on Linux Manjaro (same as Arch), but should work on any Unix OS. Of course, you need to build with new clang (tested with clang-10). helloworld.cpp: export module helloworld; import

Why my CMake GUI looks different than usual

拜拜、爱过 提交于 2020-12-23 12:09:06
问题 I have reinstalled CMake many times and still I don't have the Configure and Generate options on the CMake GUI. Can someone tell me how I can delete the old configuration? 回答1: You have hidden the CMake variables display (which includes the Configure and Generate buttons). To fix this, hover your mouse pointer over the blank gray space directly under the " Where to build the binaries " textbox near the top, and the option to resize the window pane should display as your mouse pointer. You can

Why my CMake GUI looks different than usual

北战南征 提交于 2020-12-23 12:08:09
问题 I have reinstalled CMake many times and still I don't have the Configure and Generate options on the CMake GUI. Can someone tell me how I can delete the old configuration? 回答1: You have hidden the CMake variables display (which includes the Configure and Generate buttons). To fix this, hover your mouse pointer over the blank gray space directly under the " Where to build the binaries " textbox near the top, and the option to resize the window pane should display as your mouse pointer. You can

OpenCV 3.4.2 环境搭建(适用于Ubuntu 一键安装)

核能气质少年 提交于 2020-12-22 07:11:13
前面的话 最近决定要好好地学习一下OpenCV,Ubuntu系统上简单地搭建了OpenCV环境, (Windows的搭建方法移步到 window10的搭建方法 ) ,千里之行始于足下,不积跬步无以至千里,在这里记录一下搭建过程,顺便整理了自动安装的脚本,以备下次环境自动化搭建,有部分依赖可能没有涵盖,有需要的可以直接坐飞机到文件结尾下载脚本,在此与各位看官共勉。以下是本文的大致流程。 Start安装依赖下载源码编译安装编写测试代码End 安装依赖 opencv源码配置构建需要cmake,通过cmake生成makefile,同样,也需要安装GNU make工具,当然如果要使用别的构建工具也是同样可行的。 sudo apt-get update sudo apt-get install -y build-essential sudo apt-get install -y cmake sudo apt-get install -y cmake-qt-gui sudo apt-get install -y libgtk2.0-dev pkg-config sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install -y libjpeg-dev libpng-dev

[Zephyr] 1、在linux上安装Zephyr-OS并跑DEMO

柔情痞子 提交于 2020-12-18 09:41:11
星期五, 14. 九月 2018 02:18上午 - BEAUTIFULZZZZ <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=298 height=52 src="//music.163.com/outchain/player?type=2&id=488675744&auto=0&height=32"></iframe> [TOC] 0) 前言 Zephyr™项目是一个采用Apache 2.0协议许可,Linux基金会托管的协作项目。为所有资源受限设备,构建了针对低功耗、小型内存微处理器设备而进行优化的物联网嵌入式小型、可扩展的实时操作系统(RTOS),支持多种硬件架构及多种开发板,可以在小至8 kB内存的系统上运行。 采用深入的安全开发生命周期:安全验证,模糊和渗透测试,频繁的代码审查,静态代码分析,威胁建模和审查,以防止代码中的后门 。 支持Bluetooth, Bluetooth Low Energy, Wi-Fi, 802.15.4,6Lowpan, CoAP, IPv4, IPv6, 和 NFC 等标准,通过社区驱动的发展来改进和增强功能 。 这里作为入门篇,将介绍在linux上安装Zephyr,并基于模拟器和实体开发板进行DEMO编译运行。 1)下载、克隆到本地

SQLAdvisor使用(Centos6.8版本)

纵饮孤独 提交于 2020-12-17 02:08:12
SQLAdvisor是由美团点评公司技术工程部DBA团队(北京)开发维护的一个分析SQL给出索引优化建议的工具。它基于MySQL原生态词法解析,结合分析SQL中的where条件、聚合条件、多表Join关系 给出索引优化建议。目前SQLAdvisor在美团点评广泛应用,包括美团支付、酒店旅游、外卖、团购等产品线,公司内部对SQLAdvisor的开发全面转到github上,开源和内部使用保持一致。 主要功能:输出SQL索引优化建议 下载安装包:SQLAdvisor-2.0.tar.gz rpm -q cmake libaio-devel libffi-devel glib2 glib2-devel yum install cmake libaio-devel libffi-devel glib2 glib2-devel #在SQLAdvisor编译时需要这个 rpm -ivh percona-release-0.1-3.noarch.rpm tar -xvf Percona-Server-5.6.29-76.2-rddf26fe-el6-x86_64-bundle.tar rpm -ivh Percona-Server-server-56-5.6.29-rel76.2.el6.x86_64.rpm --nodeps rpm -ivh Percona-Server-client-56-5

Linux 下连接sqlserver(下)

╄→尐↘猪︶ㄣ 提交于 2020-12-16 04:27:08
基于ODBC开发 odbc接口环境部署好后,就可以开始进行开发了,微软官网有详细的接口操作说明,但odbc接口还是太底层,操作起来比较麻烦,这里采用数据库的封装类soci来实现快速开发。 soci是一个用C++封装的数据库访问库,通过“前端(应用程序)/核心/后端(数据库适配)”模式支持firebird,mysql,sqlite3,oracle,postgresql,odbc多种数据库 安装soci git clone https://github.com/SOCI/soci.git cd soci mkdir build cd build cmake .. make sudo make install 注: 一般来说采用默认项就可以了,也可以为cmake附带一些参数: 1、设置自定义的安装目录: -DCMAKE_INSTALL_PREFIX=$HOME/local 2、指定自定义编译程序: -DCMAKE_C_COMPILER=gcc 3、如果你用的较高版本的编译器,默认是开启c++11的,如果cmake得到的SOCI_CXX11为OFF,你可以自行开启 -DSOCI_CXX11=ON, 否则后续使用时将会出现不一致的情况。 执行cmake 你会得到以下信息: 编码 这里有两种方案 1、使用dsn文件进行连接 2、指定连接字符串进行连接 soci是基于odbc进行封装的

用 20 行 python 代码实现人脸识别!

谁说胖子不能爱 提交于 2020-12-15 08:15:01
点击上方“ Python编程与实战 ”,选择“置顶公众号” 第一时间获取 Python 技术干货! 阅读文本大概需要 11分钟。 今天给大家介绍一个世界上最简洁的人脸识别库 face_recognition,你可以使用 Python 和命令行工具进行提取、识别、操作人脸。 基于业内领先的 C++ 开源库 dlib 中的深度学习模型,用 Labeled Faces in the Wild 人脸数据集进行测试,有高达99.38%的准确率。 1.安装 最好是使用 Linux 或 Mac 环境来安装,Windows 下安装会有很多问题。在安装 face_recognition 之前你需要先安装以下几个库,注意顺序! 1.1 先安装 cmake 和 boost pip install cmake pip install boost 1.2 安装 dlib pip install dlib 此处安装可能要几分钟。如安装出错,建议使用 whl 文件来安装 下载地址:https://pypi.org/simple/dlib/ 1.3 安装 face_recognition face_recongnition 一般要配合 opencv 一起使用 pip install face_recognition pip install opencv-python 2. 人脸识别 比如这里总共有三张图片

CMake FetchContent downloads external dependencies multiple times

喜夏-厌秋 提交于 2020-12-15 07:28:10
问题 I started to use FetchContent for automatical download of external dependencies. It works nicely compared to older approaches but I have one problem which is probably not related to FetchContent itself - external dependencies are downloaded multiple times. I'm actually building for Android platform but that doesn't matter much. I call CMake like this cmake -B build/arm64-v8a ... or cmake -B build/x86 ... . I need separate build folders for each ABI (arm64-v8a, x86, ...) to avoid rebuilds

std::filesystem and std::experimental::filesystem problem in different compilers

余生长醉 提交于 2020-12-15 06:47:30
问题 I am writing a library (just for learning) which utilizes std::filesystem. It works fine on MSVC however by default LTS releases of Linux like Ubuntu ships with GCC 6.x and clang in the official repository is 3.8 which doesn't have std::filesystem instead I have to use std::experimental::filesystem. How may I workaround this problem so that I can support GCC 6, GCC 8+ (where std::filesystem works), Clang 3.8, latest Clang and MSVC? I am using CMAKE as my build system 回答1: Conditional