[CMake] FreeBSD compile thinks its __APPLE_ in #ifdefs

Tim Sutton tim at linfiniti.com
Thu Mar 22 20:49:46 EST 2007


Hi


Yes I checked there was no -D__APPLE__ defined.

I will try a simple hello world app as suggested in the first response...

Regards

Tim

2007/3/22, E. Wing <ewmailing at gmail.com>:
> Very weird. I've never had this problem myself when running on
> FreeBSD. I agree with Philip and make sure something isn't defining it
> somewhere in the code. Also make sure the person didn't generate the
> CMake stuff in Apple first, and then reboot or used a shared disk in
> FreeBSD and tried reusing the generated CMake stuff and Makefiles.
>
> One other thing caught my attention. Why are you including <malloc.h>
> if Apple? In general, you shouldn't have to do this unless you're
> doing some really weird stuff. (Also, Darwin is a BSD sibling so in
> many respects, the common code should be very close to FreeBSD.)
>
> -Eric
>
>
> > Tim Sutton wrote:
> > > The code in question looks like this:
> > >
> > > 4 #ifdef __APPLE__
> > > 5 #include <malloc.h>
> > > 6 #endif
> > >
> > > So cmake has decided its an APPLE machine and is incorrectly entering
> > > this ifdef. Can any one point me to some notes on making things behave
> > > correctly on FreeBSD?
> >
> > I'd double check and make sure that __APPLE__ isn't getting accidentally
> >   defined somehow by something you're #including.
> >
> >
> > Alternatively, make a small Hello World project for CMake and verify
> > that it's actually defining __APPLE__ when you generate on FreeBSD.
> >
> > CMakeLists.txt:
> > ADD_EXECUTABLE(hello hello.cc)
> >
> > hello.cc:
> >
> > #include <iostream>
> > int main()
> > #ifdef __APPLE__
> >     std::cout << "Apple is defined!" << std::endl;
> > #endif
> >     return 0;
> > }
> >
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


-- 
-- 
Tim Sutton

Visit http://qgis.org for a great Open Source GIS
Home Page: http://linfiniti.com
Skype: timlinux
MSN: tim_bdworld at msn.com
Yahoo: tim_bdworld at yahoo.com
Jabber: timlinux
Irc: timlinux on #qgis at freenode.net


More information about the CMake mailing list