MantisBT - CMake
View Issue Details
0006337CMakeCMakepublic2008-02-13 12:252008-10-01 17:00
Brandon Van Every 
Bill Hoffman 
normalcrashalways
closedfixed 
 
 
0006337: cmake -P crashes on configure_file
It is documented that cmake -P does not have a configuration stage or a cache. However in CMake 2.4.8, if a cmake -P script attempts to execute a configure_file command, the error message says that CMake has not been built correctly. This is worrisome. Run the following script twice with cmake -P to reproduce:

set(input ${CMAKE_SOURCE_DIR}/a.txt)
if(EXISTS ${input})
  set(output ${CMAKE_BINARY_DIR}/b.txt)
  if(EXISTS ${output})
    message("${output} already exists")
  else(EXISTS ${output})
    configure_file(${input} ${output})
  endif(EXISTS ${output})
else(EXISTS ${input})
  file(WRITE ${input} "This is some text")
  message("Created ${input}")
  message("Can't use output of file(WRITE ...) for configure_file")
  message("Re-run script")
endif(EXISTS ${input})

C:\devel\src\cbugs\configure>cmake -P configure_file.cmake
Created C:/devel/src/cbugs/configure/a.txt
Can't use output of file(WRITE ...) for configure_file
Re-run script

C:\devel\src\cbugs\configure>cmake -P configure_file.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be
 built correctly.
Missing variable is:
CMAKE_BACKWARDS_COMPATIBILITY

C:\devel\src\cbugs\configure>
No tags attached.
Issue History
2008-02-13 12:25Brandon Van EveryNew Issue
2008-02-13 14:08Alex NeundorfNote Added: 0010482
2008-02-13 17:54Brandon Van EveryNote Added: 0010489
2008-02-14 15:50Alex NeundorfNote Added: 0010500
2008-02-15 10:28Bill HoffmanStatusnew => assigned
2008-02-15 10:28Bill HoffmanAssigned To => Bill Hoffman
2008-10-01 17:00Bill HoffmanStatusassigned => closed
2008-10-01 17:00Bill HoffmanResolutionopen => fixed

Notes
(0010482)
Alex Neundorf   
2008-02-13 14:08   
Can you please check how it behaves with cmake cvs ?

Alex
(0010489)
Brandon Van Every   
2008-02-13 17:54   
Interesting. Under CMake 2.5-20080213 it dies silently. No messages, either from my message() calls or from error diagnostics. No configure_file output either.
(0010500)
Alex Neundorf   
2008-02-14 15:50   
Can you get a backtrace ?