[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [Libevent-users] Visual C++ Projects



Unfortunately that cmake script is only for "finding" pre-installed
libevents and won't be of any use to a Windows user more than likely.

I use premake4 myself; I just like lua better than the CMake language.  Here
is a pair of premake scripts you can use if you can take a little time to
rework it a little to be completely self contained.  (It depends on part of
my personal build system to select between static and dll libraries, trivial
fix.  I.e. active_target is not part of premake or lua.)

For platforms other than Windows, you need to generate a config header and
put it somewhere.  Given that I only target OsX and Windows for most of my
code, this is setup to assume a local "osx" directory with the configuration
header stored in it.

I don't remember which version of libevent this is built for but it is
included in the definitions, if your version doesn't match you may need to
add/remove some files depending on libevent changes.

If you have too many problems using the above, give me a shout, it really
should be easy to generalize the above, I just don't have time tonight to do
so.  Within my build system though I've built VC2k5 up to VC2k10 projects
with no problem and used them.

KB

> -----Original Message-----
> From: owner-libevent-users@xxxxxxxxxxxxx [mailto:owner-libevent-
> users@xxxxxxxxxxxxx] On Behalf Of Kun Xi
> Sent: Thursday, June 30, 2011 7:13 PM
> To: libevent-users@xxxxxxxxxxxxx
> Cc: libevent-users@xxxxxxxx
> Subject: Re: [Libevent-users] Visual C++ Projects
> 
> I once played with libevent using cmake and msys. It is really fun:
>  - free and familiar toolchain: gcc, gdb
>  - portability
>  - cross-compiling from linux host
> 
> cmake can generate NMAKE makefile. I have never tried to use Visual
> C++.  Each version of VS, msft changes the format, it requires you to
> upgrade, and it is never opened in the lower version. That is quite
> annoying.
> 
> - Kun
> 
> FYI: the cmake module is here:
> https://github.com/facebook/hiphop-
> php/blob/master/CMake/FindLibEvent.cmake
> 
> On Thu, Jun 30, 2011 at 3:16 PM, Alexandre Parenteau
> <aubonbeurre@xxxxxxxxx> wrote:
> > Hi,
> >
> > I'm new user to libevent, and quickly becoming a fan.
> >
> > I'd need some way to build libevent on Windows for a project
> > (https://github.com/aubonbeurre/thrift/blob/alex-
> 0.6.1/README.non.blocking.Windows).
> >
> > Yesterday I spent a (frustrating) day trying to use waf (as suggested
> > on this list, nice tool, but not ready for primetime IMHO) and gyp
> > (not really meant for usage outside chromium AFAIK) to compile
> > libevent 2.0.12 on Windows (only).
> >
> > I'm actually more a scons user, and developed over time useful snippet
> > to build on various platforms (win/lin/mac), but scons has some
> > drawbacks too.
> >
> > I don't know much about cmake.
> >
> > Besides it seems to me all those above are really meant for new
> projects.
> >
> > So I'm asking something simple (I think): in order to validate
> > libevent usage in my company, we would need some plain M$ Visual C++
> > projects: it is kind of a psychological barrier to gain acceptance for
> > new components, that they have visible support for Windows, and does
> > not matter if libevent has already very good support (indeed) if it
> > lacks the VC projects, something like libevent/build/vcXX/libevent.sln
> > (xx == whatever is the latest visual studio revision).
> >
> > To sum-up:
> >
> > - Nowadays the Visual C++ XML format is quite clear, and anybody can
> > edit files manually inside the .vcproj files.
> > - libevent could include a libevent/build/vcXX/libevent.sln only
> > Debug/Release for Win32/x64 platforms (default settings)
> > - As a static library, since it does not really matter to get a test
> > suite on windows, or a nice packaging and DLL (many working still on
> > Windows are doing it for supporting old workflows, but real work
> > happen on Linux anyway)
> > - I *think* it allows also the free edtion (2010 Express) to compile
> > the library.
> >
> > What do you think?
> >
> > Thanks!
> > alex
> > ***********************************************************************
> > To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> > unsubscribe libevent-users    in the body.
> >
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users    in the body.

Attachment: LibEventProject.lua
Description: Binary data

Attachment: LibEventUsage.lua
Description: Binary data