[CMake] cmake 2.4.8 RC 10

David Thulson david.thulson at gmail.com
Wed Jan 23 16:11:59 EST 2008


On Jan 14, 2008 12:45 PM, David Thulson <david.thulson at gmail.com> wrote:
>
> On Jan 9, 2008 9:23 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> > David Thulson wrote:
> > > Hello,
> > >   This is my first post to the cmake mailing list, so I hope it
> > > works...  I downloaded the 2.4.8 RC 11 for OS X and for what it is worth
> > > it appears to work just as well as 2.4.7.  In both 2.4.7 and 2.4.8 RC 11
> > > I have some serious issues with the Xcode generator.  I just bought my
> > > first Mac (MacBook Pro running Leopard) a few months ago, so I am
> > > unfamiliar with Xcode and even OS X in general.  However, my project (
> > > http://www.crownandcutlass.com) has a unit test framework that has
> > > worked well for us on several versions and distributions of Linux as
> > > well as Windows XP.  The project is set up as a static library and the
> > > unit test framework is a separate CMake project that uses that library.
> > > Code compiled in OS X using the Makefile generator appears to work
> > > fine.  I still have a few quirks to work out for OS X, but overall it is
> > > very much as I expected.
> > >
> > >   However, if I use the Xcode generator, I have several issues.  FIrst
> > > off, we have a "config.cpp.in <http://config.cpp.in>" file that is used
> >
> > > to generate "config.cpp" as a part of the build.  The Xcode project
> > > includes a reference to a file " config.cpp.rule" which does not exist.
> > > That generates this warning:
> > > warning: no rule to process file '/(my
> > > path)/Protocce/src/config.cpp.rule' of type file for architecture i386
> > >
> > >   I can just remove that from the project and it seems to be fine until
> > > next time I regenerate the project.  No big deal, but it is a little
> > > annoying.  The bigger issue is that the resulting binary has issues
> > > catching exceptions.  Some units can catch exceptions fine, but others
> > > cannot at all.  At first, I thought I was having issues due to the
> > > visibility flags, but I am using a static lib and I believe the
> > > visibility issues only apply to dynamic libs.  The exceptions that I
> > > cannot catch pass through a "catch(...)" so I believe even with
> > > visibility issues that at least should catch the exception.
> > >
> > >   You can see my CMakeFiles here:
> > > Static lib -
> > > http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/CMakeLists.txt?revision=1020&view=markup&pathrev=1027
> > > <http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/CMakeLists.txt?revision=1020&view=markup&pathrev=1027>
> > > Unit test app -
> > > http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/test/src/CMakeLists.txt?revision=1020&view=markup&pathrev=1027
> > > <http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/test/src/CMakeLists.txt?revision=1020&view=markup&pathrev=1027>
> > >
> > >   Like I said, the same code base works fine in XP, LInux, and if I use
> > > the Makefiles it works in OS X.  I may just be doing something stupid.
> > > This is my first CMake project, and like I said I just got a Mac so I
> > > have never used Xcode outside of this attempt.  I am not sure this is
> > > worth delaying 2.4.8 since the behavior is the same as 2.4.7.  Also, I
> > > have not had time to try building a new CMake binary from CVS, sorry.
> > > However, I thought I should report what I'm experiencing before too much
> > > longer.  Let me know what I can do to help.
> > >
> >
> > Sounds like flag differences.   You should do a make VERBOSE=1 with the
> > makefile, then use cmakexbuild to build the project file.  Find a common
> > .cxx file being compiled by both, and compare the compile lines.   You
> > can post the compile lines to the list, and I might be able to help.
> > Either way it is not a regression in RC 11 but perhaps a new bug.
> >
> > -Bill
> >
>
> Here are some example build lines.  Using Xcode:
>
> CompileC ProtocceTest.build/Debug/Test.build/Objects-normal/i386/EventTest.o
> /Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/EventTest.cpp
> normal i386 c++ com.apple.compilers.gcc.4_0
>     cd /Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/bin/osx
>     /Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -pipe -Wno-trigraphs
> -fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic
> -DCMAKE_INTDIR="Debug" -fmessage-length=0 -gdwarf-2 -Wmost
> -Wno-four-char-constants -Wno-unknown-pragmas -O0
> -F/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/bin/osx/Debug
> -F/Library/Frameworks -F/Users/davidthulson/OgreSDK/Dependencies
> -F/Users/davidthulson/OISv1_0_Mac_SDK -F/System/Library/Frameworks
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/bin/osx/Debug/include
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/../../include
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/../include
> -I/usr/local/include/boost-1_34_1
> -I/System/Library/Frameworks/OpenAL.framework/Headers
> -I/Users/davidthulson/OgreSDK/Dependencies/Ogre.framework/Headers
> -I/Users/davidthulson/OISv1_0_Mac_SDK/OIS.framework/Headers
> -I/Users/davidthulson/OgreSDK/Dependencies/CEGUI.framework/Headers
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/bin/osx/ProtocceTest.build/Debug/Test.build/DerivedSources
> -c /Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/EventTest.cpp
> -o /Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/bin/osx/ProtocceTest.build/Debug/Test.build/Objects-normal/i386/EventTest.o
>
>
> Using Makefiles:
>
> /usr/bin/c++   -g
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/../../include
> -I/Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/../include
> -I/usr/local/include/boost-1_34_1
> -I/System/Library/Frameworks/OpenAL.framework/Headers
> -F/Library/Frameworks
> -I/Users/davidthulson/OgreSDK/Dependencies/Ogre.framework/Headers
> -I/Users/davidthulson/OISv1_0_Mac_SDK/OIS.framework/Headers
> -I/Users/davidthulson/OgreSDK/Dependencies/CEGUI.framework/Headers
> -F/Users/davidthulson/OgreSDK/Dependencies
> -F/Users/davidthulson/OISv1_0_Mac_SDK -F/System/Library/Frameworks  -o
> CMakeFiles/Test.dir/EventTest.o -c
> /Users/davidthulson/Documents/Code/crownandcutlass/trunk/Protocce/test/src/EventTest.cpp
>
>
>   I am surprised at how different those are, I guess I naively assumed
> that the Xcode build itself would match the Makefile build exactly
> since it is the same compiler on the same system.  I see that they are
> using compilers from different locations, though.  The "-v" output is
> the same, but diff tells me the binary files differ.  The
> "-mdynamic-no-pic" also seem interesting.  From what the man page says
> it sounds like that matters for shared libs but I am unsure if it
> matters for static libs.  When the test framework application is
> linked using Makefiles, it uses "-fPIC" but I do not see that in the
> Xcode link line.   It seems odd that "-fpascal-strings" would be
> included, but again from the man page it sounds like that allows for
> additional functionality but may not change default string behavior.
> I'm not sure though.  I have full build logs from both the static lib
> and unit test application using Xcode projects and Makefiles.  I could
> send those if anyone is interested.  Let me know if you want the full
> logs or if anything jumps out at you.  Thanks for the help.
>
> David Thulson


Hello,
  I uploaded the full build logs that those snippets were from here:
http://www.crownandcutlass.com/david/cmake/

  The logs of building the static lib start with "static_lib_" while
the test framework binary starts with "test_bin_".

  Since generating those logs, I attempted to fix the flag differences
by explicitly setting the "CMAKE_CXX_FLAGS_DEBUG" and
"CMAKE_CXX_FLAGS_RELEASE" flags, but the Xcode project does not seem
to respect those settings.  You can see the CMakeLists.txt files here:
http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/src/CMakeLists.txt?view=markup
http://crownandcutlass.svn.sourceforge.net/viewvc/crownandcutlass/trunk/Protocce/test/src/CMakeLists.txt?view=markup

  How do I change the Xcode compiler flags?  Thanks for the help.

David Thulson


More information about the CMake mailing list