[cmake-developers] [CMake 0013503]: CMake fails with Visual Studio generator if CMAKE_TOOLCHAIN_FILE is defined empty

Mantis Bug Tracker mantis at public.kitware.com
Fri Aug 31 07:42:02 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13503 
====================================================================== 
Reported By:                Stephen Kelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13503
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-08-31 07:42 EDT
Last Modified:              2012-08-31 07:42 EDT
====================================================================== 
Summary:                    CMake fails with Visual Studio generator if
CMAKE_TOOLCHAIN_FILE is defined empty
Description: 

With any cmake project with the Visual Studio 10 generator on Windows, a
specified but empty CMAKE_TOOLCHAIN_FILE causes problems:

c:\QtDev\cmaketest\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=
-- Building for: Visual Studio 10
CMake Warning (dev) at build/CMakeFiles/CMakeSystem.cmake:1 (INCLUDE):
  include() given empty file name (ignored).
Call Stack (most recent call first):

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Check for working C compiler using: Visual Studio 10
CMake Warning (dev) at C:/QtDev/cmaketest/build/CMakeFiles/CMakeSystem.cmake:1 (
INCLUDE):
  include() given empty file name (ignored).
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
CMake Warning (dev) at C:/QtDev/cmaketest/build/CMakeFiles/CMakeSystem.cmake:1 (
INCLUDE):
  include() given empty file name (ignored).
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
CMake Warning (dev) at C:/QtDev/cmaketest/build/CMakeFiles/CMakeSystem.cmake:1 (
INCLUDE):
  include() given empty file name (ignored).
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)
This warning is for project developers.  Use -Wno-dev to suppress it.

The problem seems to be 

  if(DEFINED CMAKE_TOOLCHAIN_FILE)
    set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED
"include(\"${CMAKE_TOOLCHAIN_FILE}\")")
  endif()

in CMakeDetermineSystem.cmake. I do not know why it does not hit 

    message(FATAL_ERROR "Could not find toolchain file:
${CMAKE_TOOLCHAIN_FILE}")

 earlier in that file. I also do not know why this does not fail with the NMake
makefile generator, or the Unix Makefile generator.

https://bugreports.qt-project.org/browse/QTBUG-27087

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-08-31 07:42 Stephen Kelly  New Issue                                    
======================================================================




More information about the cmake-developers mailing list