我很难在CMake中检测到一个包(glfw)。由于没有根权限,我无法将库安装在标准位置,因此我将其安装在.local中:
$ ls ~/.local/lib/cmake/glfw3/glfw3Config.cmake
/home/emil/.local/lib/cmake/glfw3/glfw3Config.cmake
我的CMakeLists.txt包括
cmake_minimum_required(VERSION 3.10.0)
project(test VERSION 1.0 LANGUAGES C CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
我正在尝试在Windows10上用CMake构建HPX (最终的目标是用MSVC构建OpenCV )。
我已经下载了Boost 1.75.0,然后从管理命令行运行了bootstrap.bat和b2.exe。然后,我将路径添加到boost文件夹的path变量。接下来,我打开CMake并尝试构建HPX1.3.0,得到以下错误:
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program F
我是CMake的新手,正在尝试了解如何配置CMake以使用忍者作为构建工具。我遇到的具体问题是,我正在尝试使用他们的install.py为vim安装YouCompleteMe插件。我得到以下错误: Searching Python 3.8 libraries...
Found Python library: /usr/lib64/libpython3.8.so
Found Python headers folder: /usr/include/python3.8
CMake Error: CMake was unable to find a build program correspondi
当我第一次尝试构建Zephyr时,我收到了这个错误消息:
CMake Error at CMakeLists.txt:1 (include):
include could not find load file:
/cmake/app/boilerplate.cmake
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for work
PKG_CONFIG_EXECUTABLE变量由FindPkgConfig.cmake设置的值无效,因此我想检查原因。为此,我增加了variable_watch(PKG_CONFIG_EXECUTABLE)。产出如下:
(...)
CMake Debug Log at /home/my/CMake/share/cmake-3.16/Modules/FindPkgConfig.cmake:27 (if):
Variable "PKG_CONFIG_EXECUTABLE" was accessed using READ_ACCESS with value
"aarc
当我编译频谱解算器时,我正在尝试使用Cmake来管理Fortran和C代码的依赖关系。但是似乎Cmake找不到编译器,尽管我已经下载了Fortran和GCC。这就是我得到的错误。我希望有人能告诉我如何解决这个问题。 the error screenshot `CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCompiler.cmake:58 (set_property):
set_property could not find CACHE variable CMAKE_Fortran_COMPILER. Perhap
我把这个放在我的顶级CMakeLists.txt中:
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/cmakebuild/bin)
MESSAGE("Value is: \n${CMAKE_BINARY_DIR} ")
add_subdirectory("sub/subA")
在子目录CMakeLists.txt中,我有一个
MESSAGE("SUBDIR Value is: \n${CMAKE_BINARY_DIR} ")
但是cmake的输出是
Value is:
/home/me/myproj/cmake
我使用Boost 1.79和Windows 10,为了构建Boost库,我使用了TDM MinGW。在尝试用CMake构建我的测试程序之后,我得到了下一个错误:
CMake Error at D:/CMake/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: log thread) (found suitable version
"1.79.0", minimum required is "1.79&
我正在尝试创建一个具有多个配置的cmake构建:调试/发布。我使用msvc,所以我可以调用cmake一次来配置调试和发布项目。
我的问题是:
我有一个自定义变量,我想通过命令行传递给cmake。
这个变量取决于!在构建类型上!
例如:
cmake -DMYVAR=alfa //if the build type is Debug
cmake -DMYVAR=beta //if the build type is Release
问题是:我希望给cmake打一次电话,并使用一个条件。(我不想用单独的值调用cmake两次)
我的选择不是CXX_FLAGS的一部分。对
我正在尝试构建使用CMake的Checked-C项目,但是当我生成makefile时,CMake给出了以下错误。
~/checkedc/build$ cmake ../llvm
CMake Error at CMakeLists.txt:57 (project):
Generator
Unix Makefiles
does not support toolset specification, but toolset
host=x64
was specified.
-- Configuring incomplete, errors occurred!
我已
当我执行的时候
cmake -DCMAKE_INSTALL_PREFIX=$KF5 .
我得到了这个错误:
Make Error at //share/cmake-3.0/Modules/CMakePackageConfigHelpers.cmake:229 (file):
file RELATIVE_PATH must be passed a full path to the file:
Call Stack (most recent call first):
CMakeLists.txt:117 (configure_package_config_file)
有什么提示吗?
我想用CMake在windows上编译一个源代码,它使用wxWigets库。我从以下页面下载了wxWigets:
在Visual构建之后,我得到了库/lib文件。我已经为wxWidgets_LIBRARIES和wxWidgets_INCLUDE_DIRS设置了路径。但下列错误无法解决。
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find wxWidgets (missing: w
我正在为带有导出目标的项目编写一个MyPackageConfig文件,以便其他项目可以轻松地找到MyPackage及其依赖项。看起来是这样的:
include(CMakeFindDependencyMacro)
find_dependency(LIB1_WITHOUT_CMAKE_CONFIG)
find_dependency(LIB2_WITH_CMAKE_CONFIG)
include (Some/Install/Dir/MyPackageTargets.cmake)
我想知道在MyPackageConfig.cmake调用之前向find_dependency添加以下行是否明智
# F
我创建并安装了aruco库,它将一个Findaruco.cmake文件放在/usr/local/lib/cmake目录中。在我的CMakeLists.txt文件中
...
find_package(aruco REQUIRED)
并且它总是返回标准错误。
By not providing "Findaruco.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "aruco", but
CMake did
我对C++编程和cmake非常陌生。如果这个问题看起来简单的话,请容忍我。
我正在构建一个应用程序,其中cmake 3.9.0是所需的最低版本。
Setup.sh: Building rpclib with libc++.
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.9.0 or higher is required. You are running version 3.5.1
因此,我计划升级cmake版本,并遵循下面的链接。
注意:为了明确起见,我不想清除现有版本,因为它可能会影响我的系统中的R
我正在尝试在一个新的ubuntu20.04.3安装上运行一个CMakeLists.txt文件。在运行cmake .时,我一直收到以下错误
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "3.1")
Call Sta
我对CMake的缓存变量感到困惑:
案例1:CACHE + FORCE
设置(CMAKE_CXX_FLAGS“我标志”缓存字符串“强制”)
- **First CMake run:** `"myflags"` appears in the `CMakeCache.txt` file as intended.
- **Command line options:** command line options do not override `"myflags"` - seems like `FORCE` has higher priority than