[Qgis-developer] [Mac OSX] Build error with CMake 2.6

Tom Elwertowski telwertowski at comcast.net
Sat May 31 12:14:13 EDT 2008


Hi Tim,

CMake 2.4 and 2.6 appear somewhat incompatible, at least for Macs. A recent upgrade of helpviewer/CMakeLists.txt to 2.6 results in failure for 2.4. Version conditionals are needed to support both versions. For example:

IF (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")
  INSTALL (TARGETS qgis_help BUNDLE DESTINATION ${QGIS_BIN_DIR})
ELSE (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")
  INSTALL (TARGETS qgis_help RUNTIME DESTINATION ${QGIS_BIN_DIR})
ENDIF (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")

Regarding Contents/CMakeLists.txt, I am baffled by the quote processing. For 2.4, not using the VERBATIM keyword produces something I would consider verbatim. When VERBATIM is added, the first backquote is not autoquoted by CMake but the second is. This causes the 2.6 error in 2.4.

For 2.6, not using VERBATIM adds some undesirable autoquoting similar to 2.4 with VERBATIM. Adding VERBATIM  for 2.6 produces even more unbalanced autoquoting than 2.4. Over an hour of probing 2.4 vs 2.6 and VERBATIM vs not VERBATIM indicates that 2.4 without VERBATIM is the only combination that doesn't mangle the expression.

The goal of this file is to extract the SVN version info from the generated header and insert it into Info.plist so that the Mac Finder will display the build number in a GetInfo dialog. Rather the parsing the header files with command-line tools, it would be better to put the SVN info into CMake variables which could be used in this CMakeLists file. I tried this when we first converted to CMake but it didn't work because the SVN header was being generated after CMake variable assignment. Therefore I would end up with the prior build number in Info.plist.

My preference is to declare that qgis/Mac does not support CMake 2.6 at this time. If someone else can get the SVN edit number into a variable that is valid when Contents/CMakeLists.txt is processed, I will rewrite this file to drop the old command-line code propagated from the prior build system.

Tom


Tim Sutton wrote:
> Hi Folks
> 
> I've been testing out CMake 2.6.0 which recently came out. On mac I  
> get everything to build except it croaks at the end with this:
> 
> Linking CXX shared module libquickprintplugin.so
> [100%] Built target quickprintplugin
> /bin/sh: -c: line 1: unexpected EOF while looking for matching ``'
> /bin/sh: -c: line 2: syntax error: unexpected end of file
> make[2]: *** [src/mac/Contents/CMakeFiles/Info.plist] Error 2
> make[1]: *** [src/mac/Contents/CMakeFiles/Info.plist.dir/all] Error 2
> make: *** [all] Error 2
> 
> It seems it has  problem parsing the bash commands in the src/mac/ 
> Contents/CMakeLists.txt. Is this something you are easily able to fix  
> Tom? I had a poke at it but all I can figure out is that cmake seems  
> to be wrapping the expression in "" or something, but I couldnt  
> figure out how to resolve the issue.
> 
> Regards


More information about the Qgis-developer mailing list