cmake

Force serial execution for specific targets in CMake

穿精又带淫゛_ 提交于 2020-08-27 22:25:52
问题 In my CMake project I have several targets which simply run a certain set of unit tests (for example, runTestsForA , runTestsForB and runTestsForC ). I also have a target, tests , that depends on all of these unit test targets, so I can run them with a single command. I'm using CLion is my IDE, which tries to use parallel make builds by default (which I want and am also doing on the Continuous Integration server). However, it looks like the tests are running in parallel too now and some tests

Setting path to Clang library in CMake

夙愿已清 提交于 2020-08-26 07:41:57
问题 I build llvm from git and want to use the libraries in a project, especially the libclang. The "makefiles" are generated by means of CMake and for the LLVM part I found the setting LLVM_DIR to reroute the path for the llvm libraries, but for Clang I cannot find such a variable and I still see in my link line (it is a Cygwin system): /usr/lib/libclang.dll.a /usr/lib/libclangTooling.dll.a . Question: which environment variable do I set to get the right build Clang libraries? 回答1: The variable

CMAKE - runtime library hidden files

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-25 07:17:19
问题 I am running Linux Redhat, I have Anaconda installed and I am trying to install a program (libspimage) using CMAKE amd I get the following warning/error: CMake Warning at src/CMakeLists.txt:74 (ADD_LIBRARY): Cannot generate a safe runtime search path for target _spimage_pybackend because files in some directories may conflict with libraries in implicit directories: runtime library [libtiff.so.5] in /usr/lib64 may be hidden by files in: /home/michantia/anaconda2/lib Some of these libraries may

Cmake question: How do I use vcpkg to install dependencies automatically?

坚强是说给别人听的谎言 提交于 2020-08-24 04:57:28
问题 I'm working on c++ project on a linux machine and it uses several boost libraries. I've installed them on my system using vcpkg and build it using the toolchain provided by vcpkg. My question is: How do I define the dependencies so that they automatically install on a different system, if they were to build it? Conan has a way of doing it by defining the dependencies in conanfile.txt. How do I do the same with vcpkg? Edit1: I've found autovcpkg which does the job I'm looking to do but can the

CMake “failed to run MSBUILD.exe” command error

南笙酒味 提交于 2020-08-21 14:08:21
问题 When I want to create visual studio 15(2017) make files for opencv 3.3.0, it gives me this error message: error in configuration process, project files maybe invalid and these: CMake Deprecation Warning at CMakeLists.txt:81 (cmake_policy): The OLD behavior for policy CMP0020 will be removed from a future version of CMake. The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term

Qt resources files with CMake and AUTORCC

流过昼夜 提交于 2020-08-21 06:05:33
问题 Solution : Add resource files in the add_executable() statement Problem (not in the add_library() ) Fail to set main window icon. Notes : When I don't use AUTORCC I run into some compilation problems: QtCore/qglobal.h: no such file or directory . But, I do prefer AUTORCC as a more modern CMake approach. Without the AUTORCC (different CMakeLists.txt than the provided) and Qt-4.6.2 the current code worked. different CMakeLists.txt) Code This is a minimized code of my project. Tree: |-

Command line equivalent of cmake's find_package?

我的未来我决定 提交于 2020-08-21 01:59:42
问题 I'm debugging a cmake file which fails to find certain packages (using find_package() ). What does find_package() actually do when it searches for packages, and can I simulate it with a command line call (without invoking cmake)? 回答1: 1. What find_package does: From the documentation of find_package(): CMake searches for a file called Find.cmake in the CMAKE_MODULE_PATH followed by the CMake installation. If the file is found, it is read and processed by CMake. On Linux, the default scripts

CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not cover global variables

家住魔仙堡 提交于 2020-08-20 05:46:38
问题 Porting a C++ library, under CMake, to Windows. Option 1: Decorate the API with __declspec(dllexport) . Option 2: set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) . We go for option 2, since it seems much easier, and leaves our sources intact. Works like a charm: our application compiles and gets linked with the library dll. However, it ensures only the export of classes and functions. What needs to be done to export global variables? Like in: lib_source.cpp: int my_secret; app.cpp: extern int my

在Jetson nano上编译paddle(带TensorRT)并跑通Paddle-Inference-Demo

限于喜欢 提交于 2020-08-20 02:10:46
懒人区:想直接安装的可以点这个链接。 ---------------------------------分割线--------------- 缘由: 在官方的Paddle-Inference-Demo中,建议Paddle版本>=1.7。 而个人能找到的资源最高的版本是Nvidia论坛的1.6.3版本的paddlepaddle-gpu。以及文档中提供的0.0.0版本( 链接 )。 https://forums.developer.nvidia.com/t/paddlepadd-gpu-1-6-3-for-jetson-nano-now-available/111655 在跑Demo的过程中,发现 文档中给出的版本 没有Paddle-TensorRT的功能 ,虽然可以使用GPU加速。但是总感觉有TensorRT但却用不上很膈应。 另外,Nvidia论坛放出的版本虽然支持TensorRT,但是版本低于Paddle-Inference-Demo要求的1.7以上。在查阅 1.6 和 1.7 的文档后,发现API有很大的不同。 我根据1.6.3支持的API对yolov3的demo修改后,**发现推理的结果有很大出入。**参见我在Github提的 issue 。当然,在运行过程中也会报model和lib版本不一致的错误。* 推测是不同版本支持的算子可能不一样(或者实现)? * 而且