由于与提及无关的原因,我希望能够将多个文件包含到工具链文件中。假设我的工具链包含以下内容:
message(STATUS "file1 is ok")
include(./build/file2)
file2 包含标识行:
message(STATUS "file2 is ok")
CMakeLists.txt 包含:
cmake_minimum_required (VERSION 2.8.8)
project (pro)
message(STATUS "cmakelists.txt is ok")
我使用以下命令调用它:
cmake -DCMAKE_TOOLCHAIN_FILE=../../build/file1 ../../
现在,我期望得到以下输出:
-- file1 is ok
-- file2 is ok
-- cmakelists.txt is ok
但我明白了:
-- file1 is ok
-- file2 is ok
-- file1 is ok
-- file2 is ok
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/cc
CMake Error at /fullpath/build/file1:2 (include):
include could not find load file:
./build/file2
Call Stack (most recent call first):
/fullpath/build/Mac/CMakeFiles/2.8.12/CMakeSystem.cmake:6 (include)
CMakeLists.txt:2 (PROJECT)
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
CMake 不仅打印了两次信息,而且在第三次之后它还声称找不到包含的文件。
有任何想法吗?
不仅cmake打印了两次信息
这是正常的:在配置过程中,会执行几个步骤。每一步都使用工具链文件。
它还声称此后第三次找不到包含的文件。有任何想法吗?
提供绝对路径。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)