Re: [Libevent-users] libevent cmake scripts
Hi, Your script doesn't generate config.h and event-config.h. New CMakeLists.txt is attached. It makes full checks and generates config.h and event-config.h. It was not tested on windows but I think it will work after slight modification. 2009/7/24 Brodie Thiesfield : > Hi all, > > It's been a while since I looked in at libevent. I appreciate greatly > the fact that libevent 1.4.11 now builds out of the box on Windows. > > Since I am using cmake now for my internal build harness, I found it > easy to create a cmake build script for libevent. This will generate > the all projects and solutions for Windows compilers (all versions). > It is more convenient for me, and since it might be useful for others, > I have made it available on this site: > > http://code.jellycan.com/memcached/ > > It creates the libevent static library, and builds the regress test > harness, and the event-test and signal-test samples. Either nmake > scripts, or solution/projects (or other cmake supported generate > types) are possible. > > Best Regards, > Brodie > ___ > Libevent-users mailing list > Libevent-users@monkey.org > http://monkeymail.org/mailman/listinfo/libevent-users > # author - Alexey Ozeritsky cmake_minimum_required(VERSION 2.6) project(libevent) INCLUDE (CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME Generic) CMAKE_FORCE_C_COMPILER(arm_v5t_le-gcc GNU) CMAKE_FORCE_CXX_COMPILER(arm_v5t_le-g++ GNU) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) include(CheckFunctionExists) include(CheckIncludeFile) include(CheckTypeSize) include(FindZLIB)# -> HAVE_LIBZ include(FindThreads) # -> HAVE_PTHREAD list(APPEND SRC buffer.c # bufferevent_pair.c # 2.0 evdns.c event_tagging.c evrpc.c evutil.c log.c signal.c evbuffer.c # 1.4 # bufferevent.c # 2.0 # bufferevent_sock.c # 2.0 event.c # evmap.c# 2.0 http.cstrlcpy.c # bufferevent_filter.c # 2.0 ) CHECK_FUNCTION_EXISTS(epoll_create HAVE_EPOLL) CHECK_FUNCTION_EXISTS(epoll_ctl HAVE_EPOLL_CTL) CHECK_FUNCTION_EXISTS(eventfd HAVE_EVENTFD) CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME) CHECK_FUNCTION_EXISTS(fcntl HAVE_FCNTL) CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO) CHECK_FUNCTION_EXISTS(getnameinfo HAVE_GETNAMEINFO) CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(inet_aton HAVE_INET_ATON) CHECK_FUNCTION_EXISTS(inet_ntop HAVE_INET_NTOP) CHECK_FUNCTION_EXISTS(inet_pton HAVE_INET_PTON) CHECK_FUNCTION_EXISTS(kqueue HAVE_KQUEUE) CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP) CHECK_FUNCTION_EXISTS(pipe HAVE_PIPE) CHECK_FUNCTION_EXISTS(poll HAVE_POLL) CHECK_FUNCTION_EXISTS(port_create HAVE_PORT_CREATE) CHECK_FUNCTION_EXISTS(select HAVE_SELECT) CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE) CHECK_FUNCTION_EXISTS(sigaction HAVE_SIGACTION) CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL) CHECK_FUNCTION_EXISTS(splice HAVE_SPLICE) CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) CHECK_FUNCTION_EXISTS(strsep HAVE_STRSEP) CHECK_FUNCTION_EXISTS(strtok_r HAVE_STRTOK_R) CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL) CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF) CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILE(fcntl.h HAVE_FCNTL_H) CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H) CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H) CHECK_INCLUDE_FILE(netinet/in6.h HAVE_NETINET_IN6_H) CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H) CHECK_INCLUDE_FILE(poll.h HAVE_POLL_H) CHECK_INCLUDE_FILE(port.h HAVE_PORT_H) CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H) CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H) CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H) CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H) CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILE(string.h HAVE_STRING_H) CHECK_INCLUDE_FILE(sys/devpoll.h HAVE_SYS_DEVPOLL_H) CHECK_INCLUDE_FILE(sys/epoll.h HAVE_SYS_EPOLL_H) CHECK_INCLUDE_FILE(sys/eventfd.h HAVE_SYS_EVENTFD_H) CHECK_INCLUDE_FILE(sys/event.h HAVE_SYS_EVENT_H) CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H) CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H) CHECK_INCLUDE_FILE(sys/queue.h HAVE_SYS_QUEUE_H) CHECK_INCLUDE_FILE(sys/select.h HAVE_SYS_SELECT_H) CHECK_INCLUDE_FILE(sys/sendfile.h HAVE_SYS_SENDFILE_H) CHECK_INCLUDE_FILE(sys/socket.h HAVE_SYS_SOCKET_H) CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H) CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE(sys/uio.h HAVE_SYS_UIO_H) CHECK_TYPE_SIZE(int SIZEOF_INT BUILTIN_TYPES_ONLY) CHECK_TYPE_SIZE(short SIZEOF_SHORT BUILTIN_TYPES_ONLY) CHECK_TYPE_SIZE(long SIZEOF_LONG BUILTIN_TYPES_ONLY) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY) if (HAVE_NETINET_IN6_H) SET(CMAKE_EXTRA_INCLUDE_FILES sys/types.h netinet/in.h sys/socket.h netinet/in
Re: [Libevent-users] libevent cmake scripts
gyp seems to be making MSVC people happy in the chromium project. (It's another take on the basic idea of cmake, written in python; see http://gyp.googlecode.com .) - Dan On Sat, Jul 25, 2009 at 7:59 AM, Kenneth Cox wrote: > A word of caution: we used cmake for a fairly large cross-platform > client-side development project. The MSVC people are not happy with the > results, and neither are the Unix people. My experience is that only > trivial compilations that are identical cross-platform can be accomplished > easily; the rest must be implemented per-platform anyway in a language > which is slightly less pleasant to program in than XSLT. > > Ken > > On Sat, 25 Jul 2009 00:13:01 -0400, Nick Mathewson > wrote: >> Thanks! That would be much appreciated. I don't know if it will >> become our primary build tool or not (we'll have to see how it works >> out), but it would sure be nice to make the MSVC people happy. > ___ > Libevent-users mailing list > Libevent-users@monkey.org > http://monkeymail.org/mailman/listinfo/libevent-users > ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] libevent cmake scripts
Hi all, On Sat, Jul 25, 2009 at 1:13 PM, Nick Mathewson wrote: > On Sat, Jul 25, 2009 at 01:07:40PM +0900, Brodie Thiesfield wrote: >> On Fri, Jul 24, 2009 at 9:42 PM, q6Yr7e0o >> nIJDVMjC wrote: >> > Would it be possible to create cmake scripts for 2.x, too since they >> > will much likely be included into the release >> >> I'll look into it, but at the moment I'm using 1.4.* releases. > > Thanks! That would be much appreciated. I don't know if it will > become our primary build tool or not (we'll have to see how it works > out), but it would sure be nice to make the MSVC people happy. The attached diff file is a first run at creating an event2 build for win32. There are a number of changes for headers files, mostly to ensure that winsock2.h is included before windows.h. I suggest that ensuring that all source files include a single top level header, or that all event2 headers include the top level header and then defining the required files there would be cleaner. winsock2.h also defines the timeval structure and some other stuff that is currently defined in compat/sys/_time.h so there is a few changes to fix that up. Some changes to ensure that all programs use the evutil_strcasecmp etc, and the event_socket_t and CLOSE_SOCKET macros (in regress I think). You can see in the diff anyhow. The diff includes the cmake files. It works for me with VC2003 and VC2008. The regress test harness runs with 3 errors. Cheers, Brodie event2-win.diff Description: Binary data ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] libevent cmake scripts
A word of caution: we used cmake for a fairly large cross-platform client-side development project. The MSVC people are not happy with the results, and neither are the Unix people. My experience is that only trivial compilations that are identical cross-platform can be accomplished easily; the rest must be implemented per-platform anyway in a language which is slightly less pleasant to program in than XSLT. Ken On Sat, 25 Jul 2009 00:13:01 -0400, Nick Mathewson wrote: > Thanks! That would be much appreciated. I don't know if it will > become our primary build tool or not (we'll have to see how it works > out), but it would sure be nice to make the MSVC people happy. ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] libevent cmake scripts
On Sat, Jul 25, 2009 at 01:07:40PM +0900, Brodie Thiesfield wrote: > On Fri, Jul 24, 2009 at 9:42 PM, q6Yr7e0o > nIJDVMjC wrote: > > Would it be possible to create cmake scripts for 2.x, too since they > > will much likely be included into the release > > I'll look into it, but at the moment I'm using 1.4.* releases. Thanks! That would be much appreciated. I don't know if it will become our primary build tool or not (we'll have to see how it works out), but it would sure be nice to make the MSVC people happy. > Incidently, the 1.4.12 release works with the current make scripts > unchanged. Nice. yrs, -- Nick ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] libevent cmake scripts
On Fri, Jul 24, 2009 at 9:42 PM, q6Yr7e0o nIJDVMjC wrote: > Would it be possible to create cmake scripts for 2.x, too since they > will much likely be included into the release I'll look into it, but at the moment I'm using 1.4.* releases. Incidently, the 1.4.12 release works with the current make scripts unchanged. Cheers, Brodie ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users
Re: [Libevent-users] libevent cmake scripts
Would it be possible to create cmake scripts for 2.x, too since they will much likely be included into the release ___ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users