[CMake] OS X and getline ?

j s j.s4403 at gmail.com
Mon Apr 25 09:52:10 EDT 2011


Hello,

I did a quick search for a bsd equivalent and found this:

http://doubletalkin.blogspot.com/2008/08/fgetln-replacement-for-getline-in-bsd.html

To use this you would probably have to use the appropriate include
guards or use a macro to redefine the name of the function.

Regards,

Juan

On Mon, Apr 25, 2011 at 8:22 AM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/4/25 AJ ONeal <coolaj86 at gmail.com>:
>> What's the preferred solution to the OS X getline problem (meaning that it
>> doesn't exist in OS X's libc) when using CMake?
>> ("Don't use getline" isn't an option)
>
> I don't think this is a CMake question.
> If you need getline on OS X then may be you'll have to provide an
> implementation when you are compiling on OS X?
> see:
> http://stackoverflow.com/questions/1117108/compiling-c-code-using-gnu-c-getline-on-mac-osx
>
>> This is my first time I've tried to compile my Linux code on OS X, so I
>> don't know anything about how to specify the "do this with os xyz and do
>> this with os abc" options.
>
> In a CMakeLists.txt one usually do something like:
>
> IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
>  list(APPEND SOURCES  mygetline.c)
> endif()
>
> Have a look at the Wiki entries too:
> http://www.cmake.org/Wiki/CMake#Basic_Introductions
> http://www.cmake.org/Wiki/CMake_HowToDoPlatformChecks
>
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list