[CMake] CMake built with Apache stdcxx has problems?

Bill Hoffman bill.hoffman at kitware.com
Tue Apr 6 14:30:27 EDT 2010


Attila Nagy wrote:
> Here is the file:
> www.orl.szote.u-szeged.hu/~attila/Slicer3Config-stdcxx.cmake
> 
> Here is another version of that same file, from the same sources, when CMake is compiled with STLport4, for reference (this is the file from my current Slicer3-build dir):
> www.orl.szote.u-szeged.hu/~attila/Slicer3Config-stlport.cmake
> 

OK, I think we found the problem...


http://viewvc.slicer.org/viewcvs.cgi/trunk/Libs/CMakeLists.txt?rev=12514&view=markup

Macro in CMake\Slicer3PersistenceMacros.cmake

http://viewvc.slicer.org/viewcvs.cgi/trunk/CMake/Slicer3PersistenceMacros.cmake?rev=6774&view=log

Seems that it is from a work around for CMake older than 2.6:

#-----------------------------------------------------------------------------
# Temporary hack to set/get persistent values accross subdirs until 2.6 
comes
# Neither set_source_file_properties nor set(... INTERNAL FORCE) would work

#-----------------------------------------------------------------------------
macro(slicer3_set_persistent_property property_name)
   set(_file "${CMAKE_BINARY_DIR}/persistent/${property_name}")
   file(WRITE "${_file}" "${ARGN}")
   #set(__${property_name} ${value} CACHE INTERNAL "" FORCE)
endmacro(slicer3_set_persistent_property property_name value)

#-----------------------------------------------------------------------------
macro(slicer3_get_persistent_property property_name var_name)
   set(_file "${CMAKE_BINARY_DIR}/persistent/${property_name}")
   if(EXISTS "${_file}")
     file(READ "${_file}" ${var_name})
   else(EXISTS "${_file}")
     set(${var_name})
   endif(EXISTS "${_file}")
   #set(${var_name} ${__${property_name}})
endmacro(slicer3_get_persistent_property property_name var_name)


You could change that macro to not use file WRITE.   IF you want to 
track this down in CMake, you could try some small examples with a CMake 
built with both versions of stdc++.   You could use file(WRITE and 
file(READ to write/read some lists from a file.

But, sounds like it is time to remove the temporary hack in Slicer...


-Bill


More information about the CMake mailing list