cmake

MinGW C compiler “not able to compile a simple test program”

拟墨画扇 提交于 2020-08-06 06:14:05
问题 I want to run MinGW as a C compiler. MinGW has been installed from Chocolatey. Invocation is from gitlab-runner through CMake. This fails with $ cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DLIB_MAN=OFF -DCMAKE_INSTALL_PREFIX=C:\opt\x64 -B. .. -- The C compiler identification is unknown -- Check for working C compiler: C:/ProgramData/chocolatey/bin/x86_64-w64-mingw32-gcc.exe -- Check for working C compiler: C:/ProgramData/chocolatey/bin/x86_64-w64-mingw32-gcc.exe --

Windows环境下为Android编译OpenCV4.3

China☆狼群 提交于 2020-08-05 18:44:24
Windows环境下为Android编译OpenCV4.3 踩了三四天的坑,今天终于顺利跑通了,原来是toolchain的问题,外网的教程大多都是用opencv source里的toolchain,会导致各种奇奇怪怪的错误(std not a member of std,canot find iostram等等) 环境配置 本文编译环境如下: cmake 3.18 Android Studio 4.0 Mingw Java JDK 8 (需要8+,过高版本可能不兼容) Apache ant1.10.7 (只编译.so库则不需要) 首先需要下载 OpenCV 4.3.0 源码 ,根据需求再加上 OpenCV_contrib 4.3.0 源码 ,解压放到你记得住的文件夹 下载 cmake 3.18 图方便直接选安装包就行 cmake-3.18.0-rc1-win64-x64.msi 下载 Mingw (建议用installer傻瓜式安装)选择下列需要安装的组件,右键选择 Mark for Installation ,之后选择 Menu -> Installation -> Apply Changes 安装完后把mingw加入系统环境变量(win键搜索环境变量就有,编辑完后 重启系统 生效) 下载 Android NDK 和 SDK,可以直接在 官网 下,但这里推荐直接在 Android

Mysql 源码安装与二进制安装

烈酒焚心 提交于 2020-08-05 17:51:13
一、源码安装mysql 在mysql官网下载mysql5.7.x的源码包 网址: https://dev.mysql.com/downloads/mysql 解压下载的mysql源码包,安装所需程序 如果cmake时出现问题,检查系统是否安装cmake,如有未安装,安装此程序: centos: yum -y install cmake gcc-c++ cmake bison-devel ncurses-devel Ubuntu:apt-get intstall cmake gcc-c++ cmake bison-devel ncurses-devel 安装完成后,重新执行cmake即可 源码编译 在执行cmake后 使用make对源码进行编译 cd mysql-5.7.25/ cmake . -DCMAKE_INSTALL_PREFIX=/home/mysql/mysql_client/mysql-5.7-25 \ -DMYSQL_DATADIR=/home/mysql/mysql-5.7-25 \ -DWITH_BOOST=/home/mysql/mysql-5.7.25/boost \ #指定boost的位置 -DSYSCONFDIR=/etc/mysql \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE

Error:Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)

倖福魔咒の 提交于 2020-08-05 05:24:32
问题 I am using Point cloud library 1.5.1. When I run CMake 3.4.0-rc2 to build my project, it has error: Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) How do I fix this error? 回答1: This error is raised because the pkg-config utility is not available on your system. Using PkgConfig with CMake is not a truly cross-platform solution, as Windows does not come with the pkg-config utility installed. (The PCL developers should instead use find_package() in their CMake. Perhaps, this is worth

CMake: What is the difference between `include_directories` versus `target_link_libraries`

杀马特。学长 韩版系。学妹 提交于 2020-08-05 05:09:17
问题 I am building a moderately sized C++ library and have cobbled together my CMakeLists.txt file from a bunch of different examples, etc. I was trying to understand the difference between include_directories versus the target_link_libraries instructions. I list some of my code below, but just wanted to preface with a comment. I use the Boost library to build some of my code. So I have an instruction to INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) to include the Boost source directories in the

CMake JNI error

北城余情 提交于 2020-08-04 09:33:08
问题 I've written a binding C++ class that calls java from C++. I am trying to compile the binding class using CMake (because the tool that will use the binding class uses CMake). However I receive the following error: CMakeFiles/JNIWrapper.dir/JNIWrapper.cpp.o: In function `createVM(JavaVM_**)': JNIWrapper.cpp:(.text+0x52): undefined reference to `JNI_CreateJavaVM' collect2: ld returned 1 exit status make[2]: *** [JNIWrapper] Error 1 make[1]: *** [CMakeFiles/JNIWrapper.dir/all] Error 2 make: ***

CMakeList set CMAKE_PREFIX_PATH

a 夏天 提交于 2020-08-04 05:56:21
问题 If I run cmake -DCMAKE_PREFIX_PATH=/home/rip/Qt/5.12.1/gcc_64/lib/cmake everything works well. But if I write set(CMAKE_PREFIX_PATH "/home/rip/Qt/5.12.1/gcc_64/lib/cmake") in the CMakeLists.txt and run only cmake, the error message below is shown: Could not find a package configuration file provided by "Qt5Quick" with any of the following names: Qt5QuickConfig.cmake qt5quick-config.cmake This is the complete code: set(CMAKE_CXX_FLAGS " -O3 -fopenmp") set(CMAKE_PREFIX_PATH "/home/rip/Qt/5.12.1

CMake how to install test files with unit tests

*爱你&永不变心* 提交于 2020-08-02 06:49:19
问题 I am using CMake to build my system and my unit tests. I am also doing an out-of-source build. I've found with the ADD_TEST() command, that you don't need to install the test executable (it will just be run when you run make install, which is great). However, my unit tests depend on some input files, which need to be copied to where the executable is built. As far as I am aware, I can't use INSTALL() to copy the files there, because I haven't specified where there is - it depends on where the

Where to set CMAKE_CONFIGURATION_TYPES in a project with subprojects

一曲冷凌霜 提交于 2020-08-01 07:42:33
问题 Lets say I have a project with two independent subprojects. If I understood cmake correctly, the idea would be to have one root CMakeLists.txt defining a project(...) and then using add_subdirectory(...) to include the subprojects. Each subproject would have its own CMakeLists.txt defining its own project. This way projects can be build either together (using the root cmake file) or individually (using the subprojects cmake file). I now would like to change the CMAKE_CONFIGURATION_TYPES .

Where to set CMAKE_CONFIGURATION_TYPES in a project with subprojects

╄→尐↘猪︶ㄣ 提交于 2020-08-01 07:40:01
问题 Lets say I have a project with two independent subprojects. If I understood cmake correctly, the idea would be to have one root CMakeLists.txt defining a project(...) and then using add_subdirectory(...) to include the subprojects. Each subproject would have its own CMakeLists.txt defining its own project. This way projects can be build either together (using the root cmake file) or individually (using the subprojects cmake file). I now would like to change the CMAKE_CONFIGURATION_TYPES .