Question

Pour les raisons non pertinentes de mentionner, je voudrais pouvoir inclure plusieurs fichiers dans le fichier de chaîne d'outils. Disons que ma chaîne d'outils contient la suite:

message(STATUS "file1 is ok")
include(./build/file2)

Le fichier2 contient la ligne d'identification:

message(STATUS "file2 is ok")

le cmakelists.txt contient:

cmake_minimum_required (VERSION 2.8.8)
project (pro)
message(STATUS "cmakelists.txt is ok")

Je l'appelle en utilisant la commande suivante:

cmake -DCMAKE_TOOLCHAIN_FILE=../../build/file1 ../../

Maintenant, je m'attendrais à la sortie suivante:

-- file1 is ok
-- file2 is ok
-- cmakelists.txt is ok

Pourtant, je comprends:

-- 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!

Non seulement CMake imprime les informations deux fois, mais elle prétend également qu'elle ne peut pas trouver des fichiers inclus à la troisième fois après cela.

Des idées?

Était-ce utile?

La solution

Non seulement Cmake imprime les informations deux fois

C'est normal: pendant la configuration, plusieurs étapes sont effectuées. À chaque étape, le fichier de chaîne d'outils utilisé.

Il prétend également qu'il ne peut pas trouver des fichiers inclus à la troisième fois après cela. Des idées?

Fournir un chemin absolu.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top