CMake 3.4.0包含多个文件

时间:2015-11-07 13:06:27

标签: cmake

之前我正在使用CMake 2.8.10.1,而配置时则没问题。现在,当我切换到CMake 3.4.0时,相同的CMakelists.txt会出现以下错误:

CMake Error at CMakeLists.txt:31 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.

我再次使用旧的CMake,并且使用相同的文件工作正常。以下是CMakelists的一部分

FIND_PACKAGE ( ITK)
IF ( ITK_FOUND)
INCLUDE( ${USE_ITK_FILE} )  //Line 31
ENDIF( ITK_FOUND)

我需要在这里更改一些语法吗?

1 个答案:

答案 0 :(得分:1)

原因是USE_ITK_FILE现在已经过时,由于向后兼容性,它正在使用2.8.10.1。如给定here

#  USE_ITK_FILE - The full path to the UseITK.cmake file.  
#                 This is provided for backward 
#                 compatability.  Use ITK_USE_FILE
#                 instead.

我将其更改为ITK_USE_FILE并且有效。

相关问题