cmake

Could not find PROTOBUF Compiler

吃可爱长大的小学妹 提交于 2020-02-03 08:02:11
问题 I'm trying to do a CMake with Caffe, but my system cannot find protobuf compiler. I have previously installed protobuf2.7.0. Now I switched back to 2.6.1. How could I configure my CMake to recognize the protobuf2.6.1 compiler? I have done $ sudo apt-get install libprotobuf-dev protobuf-compiler $ protoc --version libprotoc 2.6.1 But when I try to cmake Caffe, it still gives me the error user@user-computer:~/caffe/build$ cmake -DBLAS=open .. -- Boost version: 1.58.0 -- Found the following

cocos2d-x-4.0 cmake 构建项目

杀马特。学长 韩版系。学妹 提交于 2020-02-03 07:56:59
cocos2d-x-4.0升级有点大,我没找到python脚本构建项目的方法。结合官方文档和网友们的经验,使用cmake成功构建了项目(首先你的机器要装cmake)。步骤如下: 下载cocos2d-x-4.0压缩包 https://download.cocos.com/Cocos2D-X/cocos2d-x-4.0.zip 解压后,cd到解压出来的目录,在该目录里创建"win32-build"目录,并cd进去。 执行: cmake .. -G"Visual Studio 16 2019" -Tv142 -A win32 .. 我的vs是2019版,如果你是2017可以执行: cmake .. -G"Visual Studio 15 2017" -Tv141 -A win32 .. 如果你想要64位项目可以把-A win32 ..去掉,构建出来的项目默认就是64位的。 打开Cocos2d-x.sln,编译没有提示错误,编译成功了。 来源: CSDN 作者: 晨风夕月阶柳庭花 链接: https://blog.csdn.net/gaoshou_zgt/article/details/104144340

Configure CMake in windows to use clang from command line to get modern OpenMP support

末鹿安然 提交于 2020-02-03 04:07:45
问题 I have a small test project that uses OpenMP for parallelization. My target is to compile it so it produces .dll and .lib for libraries (because my real project links to external libraries distributed using these types), with support for OpenMP 4.5 or newer and do it from the command line so it can be done on a docker for testing and checking (the docker part is out of the scope of this question, it is just for reference on why I need it to work from the command line). I can compile this

CMake per file optimizations

烂漫一生 提交于 2020-02-02 11:47:57
问题 Elsewhere the question has been asked, "How do I turn off optimizations on one file?" The answer is usually something like this: cmake_minimum_required( VERSION 3.8 ) project( Hello ) add_executable( hello hello.c foo.c bar.c ) set( CMAKE_C_FLAGS_RELEASE "" ) set( CMAKE_CXX_FLAGS_RELEASE "" ) set_source_files_properties( hello.c PROPERTIES COMPILE_FLAGS -O0 ) This works unless you invoke cmake like this: cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../hello And you get this in your build.ninja

CMake per file optimizations

孤街醉人 提交于 2020-02-02 11:46:37
问题 Elsewhere the question has been asked, "How do I turn off optimizations on one file?" The answer is usually something like this: cmake_minimum_required( VERSION 3.8 ) project( Hello ) add_executable( hello hello.c foo.c bar.c ) set( CMAKE_C_FLAGS_RELEASE "" ) set( CMAKE_CXX_FLAGS_RELEASE "" ) set_source_files_properties( hello.c PROPERTIES COMPILE_FLAGS -O0 ) This works unless you invoke cmake like this: cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../hello And you get this in your build.ninja

CMake per file optimizations

老子叫甜甜 提交于 2020-02-02 11:45:32
问题 Elsewhere the question has been asked, "How do I turn off optimizations on one file?" The answer is usually something like this: cmake_minimum_required( VERSION 3.8 ) project( Hello ) add_executable( hello hello.c foo.c bar.c ) set( CMAKE_C_FLAGS_RELEASE "" ) set( CMAKE_CXX_FLAGS_RELEASE "" ) set_source_files_properties( hello.c PROPERTIES COMPILE_FLAGS -O0 ) This works unless you invoke cmake like this: cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../hello And you get this in your build.ninja

Windows10 环境下使用 Cmake 和 MinGW-w64 编译安装 OpenCV 4.0.1

时光毁灭记忆、已成空白 提交于 2020-01-31 15:20:13
一、系统及软件环境 Windows-10-64bit MinGW-w64-x86_64-8.1.0-release-posix-seh-rt_v6-rev0 CMake-3.13.1 opencv-4.0.1-vc14_vc15 二、安装 MinGW-w64 并配置其环境变量 通过 window 安装文件来安装 下载 MinGW-w64,下载地址: MinGW-w64 - for 32 and 64 bit Windows 安装 MinGW-w64。以管理员的身份执行安装程序,根据自己环境的情况选择安装包 然后执行下一步,如果这步出现错误就 通过离线的方式来配置 离线配置 MinGW-w64. 如果使用 .exe 文件安装出现错误,可以通过离线的方式来配置 MinGW-w64。具体步骤参考下面内容。 通过离线包进行安装 下载对应版本的离线包,下载地址: x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z 提取文件到任意路径,我是直接放在 C:\ 目录下; 配置环境变量,将 X:\mingw64\bin ( X 为提取目录) 添加到环境变量的 path 变量中,然后打开命令行执行器输入 gcc -v , 如果出现对应的版本号则表示配置成功。 三、使用 Cmake 生成 OpenCV 的 Makefile 下载对应平台的 cmake 并安装

Cannot install CMake for Mac OS X 10.8 [closed]

时光毁灭记忆、已成空白 提交于 2020-01-31 06:46:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I do not have cmake in terminal, so I went to it's webpage download page, downloaded the "Mac OSX 64/32-bit Universal (for Intel, Snow Leopard/10.6 or later)" item, and the installer does nothing! I tried all 3 of them!!! can anyone help me install cmake ????? huge thanks in advance! EDIT: system info: OSX 10.8

使用CMake交叉编译Arm Linux程序

自古美人都是妖i 提交于 2020-01-31 03:17:07
我们平常使用CMake时,主要是在x86或x86_64平台上,其实CMake在2.6版本后就已经支持交叉编译了,下面就来看下如何使用CMake进行Arm Linux程序的交叉编译。 一 建立工程 按照如下结构体建立一个简单工程 main.c内容如下, # include <stdio.h> int main ( void ) { printf ( "hello world\n" ) ; return 0 ; } CMakeLists.txt内容如下, cmake_minimum_required ( VERSION 3.5 ) project ( demo ) add_executable ( main main . c ) 这是常规的工程,编译的话只要cd到build目录下执行 cmake .. && make 就可以了。 二 交叉编译 现在希望最终编译的程序是运行在arm linux系统上的,这就需要交叉编译。 1. 设置系统和工具链 对于交叉编译,CMake并不知道目标系统是什么,所以需要设置一些CMake变量来告知CMake, CMAKE_SYSTEM_NAME:即目标系统名,这里是Linux CMAKE_SYSTEM_PROCESSOR :目标系统的处理器名,这里是arm 对于工具链,则是通过下面2个变量来定位, CMAKE_C_COMPILER:C编译器的可执行文件名称

CMake快速上手教程

佐手、 提交于 2020-01-30 16:39:08
教程框架 起点(Step 1) 1. 编译单目录工程 1.创建工程文件夹 2.进入src目录,编写一个main.c文件 3.编写工程顶层目录的CMakeLists.txt 4.编写子目录src的CMakeLists.txt 5.最后的工程目录结构 6.编译工程 2. 编译多目录工程 1.创建工程目录 2.编写hello模块 3.编写world模块 4.编写主模块 5.编写顶层目录的CMakeLists.txt文件 6.最后的工程目录结构 7.编译工程 本文由简书站上的多篇博客经我验证后修改了错误 + 细化步骤 + 严谨地审查,后发表。 参考文章链接1:https://www.jianshu.com/p/8df5b2aba316 参考文章链接2:https://www.jianshu.com/p/6df3857462cd CMake中文手册:http://www.cnblogs.com/coderfenghc/tag/cmake/ 起点(Step 1) 参看下面的CMakeLists.txt文件,最简单的一个工程需要有一个这样的cmake文件,一共就这么两行 cmake_minimum_required ( VERSION 3.5 ) project ( hello ) add_executable ( hello hello.c ) 注意到这里都是用的小写的命令