[cmake-developers] [CMake 0011963]: Assertion `in_remote[0] != '\"'' failed.

Mantis Bug Tracker mantis at public.kitware.com
Sat Mar 12 12:29:49 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=11963 
====================================================================== 
Reported By:                Caesar
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11963
Category:                   CMake
Reproducibility:            have not tried
Severity:                   crash
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-03-12 12:29 EST
Last Modified:              2011-03-12 12:29 EST
====================================================================== 
Summary:                    Assertion `in_remote[0] != '\"'' failed.
Description: 
I got this

cmake: ../../Source/cmLocalGenerator.cxx:2359: std::string
cmLocalGenerator::ConvertToRelativePath(const
                    std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
                    std::char_traits<char>, std::allocator<char> > > >&, const
char*, bool): Assertion `in_remote[0] != '\"'' failed.

after -- Configuring done

Steps to Reproduce: 
To reproduce, you can pull http://hg.openclonk.org/openclonk/rev/c6007540604b
and apply 

diff -r 5345b54de388 CMakeLists.txt
--- a/CMakeLists.txt    Sat Mar 12 13:47:46 2011 +0100
+++ b/CMakeLists.txt    Sat Mar 12 18:24:54 2011 +0100
@@ -1031,6 +1031,21 @@
 endforeach()

 ############################################################################
+# Precompiled header support, gcc part (it needs the cxx flags)
+############################################################################
+
+include(GccPchSupport.cmake)
+if(CMAKE_COMPILER_IS_GNUCXX)
+       if(NOT DEFINED USE_GCC_PCH)
+               message("Using GCC precompiled headers! USE_GCC_PCH=Off to
disable.")
+       endif()
+       option(USE_GCC_PCH "Use GCC precompiled headers" ON)
+endif()
+if(USE_GCC_PCH)
+       add_precompiled_header(clonk src/C4Include.h)
+endif()
+
+############################################################################
 # Locate optional libraries (if so desired)
 ############################################################################
 CHECK_INCLUDE_FILE_CXX(getopt.h HAVE_GETOPT_H)
diff -r 5345b54de388 GccPchSupport.cmake
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/GccPchSupport.cmake       Sat Mar 12 18:24:54 2011 +0100
@@ -0,0 +1,71 @@
+#Copied from http://www.mail-archive.com/cmake@cmake.org/msg04394.html which
copied it from the rosengarden project
+#see also: http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Precompiled-Headers.html
+
+MACRO(ADD_PRECOMPILED_HEADER _targetName _input )
+
+       if(CMAKE_BUILD_TYPE)
+           SET(_proper_build_type ${CMAKE_BUILD_TYPE})
+       else()
+           SET(_proper_build_type Release)
+       endif()
+
+       SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
+                       SET(_outdir "CMakeFiles/pch.custom.dir/${_input}.gch")
+       MAKE_DIRECTORY(${_outdir})
+       SET(_output "${_outdir}/${_targetName}_${_proper_build_type}.o")
+       #GET_FILENAME_COMPONENT(_name ${_input} NAME)
+       #SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
+       #SET(_outdir "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
+       #MAKE_DIRECTORY(${_outdir})
+       #SET(_output "${_outdir}/${CMAKE_BUILD_TYPE}.c++")
+
+       STRING(TOUPPER "CMAKE_CXX_FLAGS_${_proper_build_type}" _flags_var_name)
+       if(CMAKE_CXX_COMPILER_ARG1)
+                                       STRING(STRIP CMAKE_CXX_COMPILER_ARG1
_ccache_tweak)
+                               SET(_ccache_tweak "${_ccache_tweak}")
+       endif()
+       SET(_compiler_FLAGS ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
+                               GET_DIRECTORY_PROPERTY(_compile_defines
COMPILE_DEFINITIONS)
+       FOREACH(item ${_compile_definitions})
+       LIST(APPEND _compiler_FLAGS "-D\"${item}\"")
+       ENDFOREACH(item)
+       GET_DIRECTORY_PROPERTY(_compile_defines
COMPILE_DEFINITIONS_${_proper_build_type})
+       FOREACH(item ${_compile_definitions})
+       LIST(APPEND _compiler_FLAGS "-D\"${item}\"")
+       ENDFOREACH(item)
+       GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
+       FOREACH(item ${_directory_flags})
+       LIST(APPEND _compiler_FLAGS "-I\"${item}\"")
+       ENDFOREACH(item)
+                               GET_DIRECTORY_PROPERTY(_directory_flags
DEFINITIONS)
+       LIST(APPEND _compiler_FLAGS ${_directory_flags})
+       SEPARATE_ARGUMENTS(_compiler_FLAGS)
+       #STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
+       #SET(_compiler_FLAGS ${${_flags_var_name}})
+       #
+       #GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
+       #FOREACH(item ${_directory_flags})
+       #                       LIST(APPEND _compiler_FLAGS "-I${item}")
+       #ENDFOREACH(item)
+       #
+       #GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
+       #LIST(APPEND _compiler_FLAGS ${_directory_flags})
+
+       #SEPARATE_ARGUMENTS(_compiler_FLAGS)
+       #MESSAGE("_compiler_FLAGS: ${_compiler_FLAGS}")
+       #message("${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header -o
${_output} ${_source}")
+       ADD_CUSTOM_COMMAND(
+           OUTPUT ${_output}
+           COMMAND "\"${CMAKE_CXX_COMPILER}\""
+               ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}
+           DEPENDS ${_source}
+       )
+       ADD_CUSTOM_TARGET(${_targetName}_pch DEPENDS ${_output} VERBATIM)
+       ADD_DEPENDENCIES(${_targetName} ${_targetName}_pch)
+       #SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-include ${_name}
-Winvalid-pch-H")
+       #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${_name}
-Winvalid-pch")
+       #SET_TARGET_PROPERTIES(${_targetName} PROPERTIES
+       #COMPILE_FLAGS "-include ${_name} -Winvalid-pch"
+       #)
+
+ENDMACRO(ADD_PRECOMPILED_HEADER)

Additional Information: 
The assertion will only be triggered if ADD_CUSTOM_COMMAND is called. The
crucial line although is COMMAND "\"${CMAKE_CXX_COMPILER}\"", using COMMAND
"${CMAKE_CXX_COMPILER}" works fine. I know that the former makes nearly no
sense, but it shouldn't trigger an assertion.

Besides, I use CMake 2.8.2.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-12 12:29 Caesar         New Issue                                    
======================================================================




More information about the cmake-developers mailing list