cmake

How to build and link google benchmark using cmake in windows

两盒软妹~` 提交于 2020-01-24 20:14:33
问题 I am trying to build google-benchmark and use it with my library using cmake. I have managed to build google-benchmark and run all its tests successfully using cmake. I am unfortunately unable to link it properly with my c++ code in windows using cmake or cl. the problem I think is that google-benchmark builds the library inside the src folder, i.e it is build in src/Release/benchmark.lib now i cannot point to it in cmake if I use ${benchmark_LIBRARIES} it looks for the library in the Release

Turn on compiler optimization for Android Studio debug build via Cmake

岁酱吖の 提交于 2020-01-24 13:07:25
问题 I am using Android Studio 3.0 for my NDK based app. For the C++ code, I use CMake as the external builder. This works well, I can create debug and release binaries. However, I would like to turn on compiler optimizations (say -O3) for a part of the C++ code (the physics engine), not just for the release build, but also for the debug build. So create the bulk of the debug build as is, without optimizing, yet, I want one of the static library targets to be built with the compiler optimization

Turn on compiler optimization for Android Studio debug build via Cmake

假装没事ソ 提交于 2020-01-24 13:07:07
问题 I am using Android Studio 3.0 for my NDK based app. For the C++ code, I use CMake as the external builder. This works well, I can create debug and release binaries. However, I would like to turn on compiler optimizations (say -O3) for a part of the C++ code (the physics engine), not just for the release build, but also for the debug build. So create the bulk of the debug build as is, without optimizing, yet, I want one of the static library targets to be built with the compiler optimization

How to put files generated by CMAKE_AUTOMOC in specific folder

て烟熏妆下的殇ゞ 提交于 2020-01-24 13:02:53
问题 I am doing a out of source build with CMake. It is my current folder structure: |_ProjectRoot |_build |_src |_inc Since I am using Qt, my CMakeLists.txt file contains these line in order to generate required ui_*.h and moc_*.h : set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) All ui_*.h and moc_*.h files are put in ProjectRoot\build by default. Is there any chance I can specify the moc_*.h generated to be put under ProjectRoot\moc and ui_*.h to be put under

How to put files generated by CMAKE_AUTOMOC in specific folder

走远了吗. 提交于 2020-01-24 13:02:05
问题 I am doing a out of source build with CMake. It is my current folder structure: |_ProjectRoot |_build |_src |_inc Since I am using Qt, my CMakeLists.txt file contains these line in order to generate required ui_*.h and moc_*.h : set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) All ui_*.h and moc_*.h files are put in ProjectRoot\build by default. Is there any chance I can specify the moc_*.h generated to be put under ProjectRoot\moc and ui_*.h to be put under

Finding CUDA_SDK_ROOT_DIR

六眼飞鱼酱① 提交于 2020-01-24 11:41:18
问题 I am trying to set up Point Cloud Library trunk build with CUDA options enabled. I believe I have installed CUDA correctly, following these instructions. In the cmake options for the PCL build, some options are unrecognised: Is there something I can manually set CUDA_SDK_ROOT_DIR to? Likewise for the other unfound options. 回答1: CUDA_SDK_ROOT_DIR should be set to the direction in which you installed the NVIDIA's GPU Computing SDK. The GPU Computing SDK is downloadable from the same page at

Finding CUDA_SDK_ROOT_DIR

£可爱£侵袭症+ 提交于 2020-01-24 11:40:09
问题 I am trying to set up Point Cloud Library trunk build with CUDA options enabled. I believe I have installed CUDA correctly, following these instructions. In the cmake options for the PCL build, some options are unrecognised: Is there something I can manually set CUDA_SDK_ROOT_DIR to? Likewise for the other unfound options. 回答1: CUDA_SDK_ROOT_DIR should be set to the direction in which you installed the NVIDIA's GPU Computing SDK. The GPU Computing SDK is downloadable from the same page at

Mxnet C++接口安装以及收集到的资料整理

为君一笑 提交于 2020-01-24 10:53:57
Mxnet C++接口 install C++接口需要从源码编译安装 跟着教程来也很简单(无脑复制粘贴) ubuntu安装地址 官方的 STEP1 里安装了 OpenBLAS 数学库(后面STEP3是三个命令选一个,我选 For a CPU-only build with OpenBLAS math library run: ) 跟随官网教程做到 STEP3 时候需要注意的点: 运行cmake时候要添加参数 -USE_CPP_PACKAGE=1 ,这样才会开启C++接口,比如这样: rm -rf build mkdir -p build && cd build cmake -GNinja \ -DUSE_CUDA = OFF \ -DUSE_MKL_IF_AVAILABLE = OFF \ -DCMAKE_BUILD_TYPE = Release \ -USE_CPP_PACKAGE = 1 \ .. ninja 如果是笔记本推荐直接用CPU的跑就行了,如果选GPU,我没折腾过不知道会不会有什么坑。。。我选择的是 For a CPU-only build with OpenBLAS math library run: 因为 STEP1 里安装了 完成编译之后,就会生成.so和.a两个文件,文件位置可能在lib里(我跟着mac的教程是生成在lib里)也有可能在build文件夹里

Cmake: add_custom_command argument based on variable content

陌路散爱 提交于 2020-01-24 06:55:27
问题 I'd like to have a Cmake function to copy some binaries to a specific location. Fo this I have the following function definition : function ( collect_binaries TARGET_NAME DEST_DIR ) set ( targetsToCopy ${ARGN} ) set ( copy_cmd "COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}\n" ) foreach ( target ${targetsToCopy} ) LIST( APPEND copy_cmd "COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${DEST_DIR}$<TARGET_FILE_NAME:${target}>\n") endforeach( target ${targetsToCopy} ) #message(