+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse-cdt version="2.0"?>
-
-<cdtproject id="org.eclipse.cdt.make.core.make">
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<data>
-<item id="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-</item>
-<item id="org.eclipse.cdt.core.pathentry">
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</item>
-</data>
-</cdtproject>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?fileVersion 4.0.0?>
-
-<cproject>
-<storageModule moduleId="org.eclipse.cdt.core.settings">
-<cconfiguration id="converted.config.1659390386">
-<storageModule moduleId="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="false" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="false"/>
-</scannerInfoProvider>
-</profile>
-</storageModule>
-<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1659390386" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
-<externalSettings/>
-<extensions>
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser">
-<attribute key="addr2line" value="addr2line"/>
-<attribute key="c++filt" value="c++filt"/>
-</extension>
-</extensions>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
-<buildTargets>
-<target name="all" path="" targetID="org.eclipse.cdt.make.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments>-C build</buildArguments>
-<buildTarget>all</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>false</useDefaultCommand>
-<runAllBuilders>false</runAllBuilders>
-</target>
-</buildTargets>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
-<doc-comment-owner id="org.eclipse.cdt.ui.doxygen">
-<path value=""/>
-</doc-comment-owner>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.pathentry">
-<pathentry base-path="libasyncio" include="utils" kind="inc" path="" system="true"/>
-<pathentry base-path="libasyncio" include="build" kind="inc" path="" system="true"/>
-<pathentry base-path="libasyncio" include="asyncio" kind="inc" path="" system="true"/>
-<pathentry kind="src" path=""/>
-<pathentry kind="out" path=""/>
-<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
-</storageModule>
-</cconfiguration>
-</storageModule>
-</cproject>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>libasyncio</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.make.core.makeBuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>org.eclipse.cdt.core.errorOutputParser</key>
- <value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.append_environment</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.arguments</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.command</key>
- <value>make</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.location</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.target.auto</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.target.clean</key>
- <value>clean</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.build.target.inc</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableFullBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.environment</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.stopOnError</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.core.cnature</nature>
- <nature>org.eclipse.cdt.make.core.makeNature</nature>
- <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
- <nature>org.eclipse.cdt.core.ccnature</nature>
- </natures>
-</projectDescription>
--- /dev/null
+# Project
+project(libasyncio)
+set(VERSION 0.2)
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
+
+# CMake
+set(CMAKE_COLOR_MAKEFILE ON)
+cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
+
+# Source package generation
+set(CPACK_SOURCE_GENERATOR TGZ)
+set(CPACK_SOURCE_IGNORE_FILES "~$;\\\\.git;build;build-rpm")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}")
+
+# Find external packages
+include(FindPkgConfig)
+
+option(WITH_LIBI2NCOMMON OFF)
+if(WITH_LIBI2NCOMMON)
+ pkg_check_modules(LIBI2NCOMMON REQUIRED libi2ncommon)
+ include_directories(${LIBI2NCOMMON_INCLUDE_DIRS})
+ link_directories(${LIBI2NCOMMON_LIBRARY_DIRS})
+elseif(WITH_LIBI2NCOMMON)
+ message(STATUS "[!] Building *without* libi2ncommon support. [!]")
+endif(WITH_LIBI2NCOMMON)
+
+find_package(Boost 1.34 REQUIRED COMPONENTS signals unit_test_framework)
+include_directories(${Boost_INCLUDE_DIRS})
+
+option(WITH_LIBT2N OFF)
+if(WITH_LIBT2N)
+ pkg_check_modules(LIBT2N REQUIRED libt2n)
+ include_directories(${LIBT2N_INCLUDE_DIRS})
+ link_directories(${LIBT2N_LIBRARY_DIRS})
+ # set(T2NDIRS glue_t2n)
+elseif(WITH_LIBT2N)
+ message(STATUS "[!] Building *without* libt2n support. [!]")
+endif(WITH_LIBT2N)
+set(T2NDIRS glue_t2n)
+
+# Documentation
+find_package(Doxygen)
+if(DOXYGEN_FOUND)
+ # Find doxy config
+ message(STATUS "Doxygen found.")
+ set(DOXY_DIR "${CMAKE_SOURCE_DIR}/doc")
+ set(DOXY_CONFIG "${DOXY_DIR}/Doxyfile.in")
+
+ # Copy doxy.config.in
+ configure_file("${DOXY_CONFIG}" "${CMAKE_BINARY_DIR}/doxy.config")
+
+ # Create doc directory
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/doc
+ COMMAND rm -rf ${CMAKE_BINARY_DIR}/doc/{html,man}
+ COMMAND mkdir -p ${CMAKE_BINARY_DIR}/doc
+ DEPENDS utils asyncio ${T2NDIRS} unittest
+ )
+
+ # Run doxygen
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/doc/html/index.html
+ COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_BINARY_DIR}/doxy.config"
+ DEPENDS "${CMAKE_BINARY_DIR}/doxy.config" "${CMAKE_BINARY_DIR}/doc"
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc
+ )
+
+ add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
+
+ message(STATUS "Generating API documentation with Doxygen.")
+else(DOXYGEN_FOUND)
+ message(STATUS "Not generating API documentation.")
+endif(DOXYGEN_FOUND)
+
+# Spec file
+configure_file(${CMAKE_SOURCE_DIR}/libasyncio.spec.in ${CMAKE_SOURCE_DIR}/libasyncio.spec @ONLY)
+
+# Check include files and availability of libraries for config file
+include(CheckIncludeFiles)
+
+if(Boost_FOUND)
+ set(HAVE_BOOST 1)
+endif()
+if(Boost_SIGNALS_FOUND)
+ set(HAVE_BOOST_SIGNALS 1)
+endif()
+if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
+ set(HAVE_BOOST_UNIT_TEST_FRAMEWORK 1)
+endif()
+if(LIBI2NCOMMON_FOUND)
+ set(HAVE_LIBI2NCOMMON 1)
+endif()
+if(LIBT2N_FOUND)
+ set(HAVE_LIBT2N 1)
+endif()
+check_include_files(dlfcn.h HAVE_DLFCN_H)
+check_include_files(inttypes.h HAVE_INTTYPES_H)
+check_include_files(memory.h HAVE_MEMORY_H)
+check_include_files(stdint.h HAVE_STDINT_H)
+check_include_files(stdlib.h HAVE_STDLIB_H)
+check_include_files(strings.h HAVE_STRINGS_H)
+check_include_files(string.h HAVE_STRING_H)
+check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+check_include_files(sys/types.h HAVE_SYS_TYPES_H)
+check_include_files(unistd.h HAVE_UNISTD_H)
+set(STDC_HEADER_NAMES
+ assert.h
+ ctype.h
+ errno.h
+ float.h
+ limits.h
+ locale.h
+ math.h
+ setjmp.h
+ signal.h
+ stdarg.h
+ stddef.h
+ stdio.h
+ stdlib.h
+ string.h
+ time.h
+)
+check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS)
+
+# Config file
+# configure_file(${CMAKE_SOURCE_DIR}/asyncio_config.hpp.in.cmake ${CMAKE_BINARY_DIR}/asyncio_config.hpp)
+# include_directories(BEFORE ${CMAKE_BINARY_DIR})
+configure_file(${CMAKE_SOURCE_DIR}/asyncio_config.hpp.in.cmake ${CMAKE_SOURCE_DIR}/asyncio/asyncio_config.hpp)
+# include_directories(BEFORE ${CMAKE_SOURCE_DIR}/asyncio)
+
+# PkgConfig output
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+
+# PkgConfig files
+configure_file(${CMAKE_SOURCE_DIR}/asyncio/libasyncio.pc.in ${CMAKE_BINARY_DIR}/asyncio/libasyncio.pc @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/utils/libasyncio_utils.pc.in ${CMAKE_BINARY_DIR}/utils/libasyncio_utils.pc @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/glue_t2n/libasyncio_t2n.pc.in ${CMAKE_BINARY_DIR}/glue_t2n/libasyncio_t2n.pc @ONLY)
+
+install(FILES ${CMAKE_BINARY_DIR}/asyncio/libasyncio.pc DESTINATION lib/pkgconfig)
+install(FILES ${CMAKE_BINARY_DIR}/utils/libasyncio_utils.pc DESTINATION lib/pkgconfig)
+install(FILES ${CMAKE_BINARY_DIR}/glue_t2n/libasyncio_t2n.pc DESTINATION lib/pkgconfig)
+
+# Subdirectories
+set(CPACK_SET_DESTDIR "ON")
+add_subdirectory(utils)
+add_subdirectory(asyncio)
+# if(${WITH_LIBT2N})
+add_subdirectory(${T2NDIRS})
+# endif(${WITH_LIBT2N})
+add_subdirectory(unittest)
+
+include(CPack)
+++ /dev/null
-AUTOMAKE_OPTIONS = foreign 1.4
-ACLOCAL_AMFLAGS = -I m4macros
-
-if HAVE_LIBT2N
-T2NDIRS = glue_t2n
-else
-T2NDIRS =
-endif
-
-SUBDIRS = utils asyncio $(T2NDIRS) unittest doc
-
-EXTRA_DIST = LICENSE COPYING.GPL libasyncio.spec
--- /dev/null
+# Sources
+set(libasyncio_SOURCES
+ async_callout.cpp
+ async_io.cpp
+ async_pipe.cpp
+ async_process.cpp
+ async_socket.cpp
+ async_timer.cpp
+)
+set(libasyncio_HEADERS
+ async_callout.hpp
+ async_io.hpp
+ async_pipe.hpp
+ async_process.hpp
+ async_socket.hpp
+ async_timer.hpp
+ asyncio_config.hpp
+)
+include_directories(BEFORE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/utils
+ ${CMAKE_SOURCE_DIR}/utils/i2ncommon
+ )
+
+# Libraries
+add_library(libasyncio SHARED ${libasyncio_SOURCES} ${libasyncio_HEADERS})
+set_target_properties(libasyncio PROPERTIES VERSION ${VERSION} SOVERSION 0)
+set_target_properties(libasyncio PROPERTIES OUTPUT_NAME asyncio)
+set_target_properties(libasyncio PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+add_library(libasyncio-static STATIC ${libasyncio_SOURCES} ${libasyncio_HEADERS})
+set_target_properties(libasyncio-static PROPERTIES OUTPUT_NAME asyncio)
+set_target_properties(libasyncio-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+# Dependencies
+target_link_libraries(libasyncio ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES})
+target_link_libraries(libasyncio-static ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES})
+
+# Headerlist
+foreach(header_file_in ${libasyncio_HEADERS})
+ set(header_files_out "${header_files_out}${includedir}/${header_file_in}\n")
+endforeach()
+file(WRITE ${CMAKE_BINARY_DIR}/headerlist.asyncio ${header_files_out})
+
+# Installation
+install(TARGETS libasyncio LIBRARY DESTINATION lib)
+install(TARGETS libasyncio-static ARCHIVE DESTINATION lib)
+install(FILES ${libasyncio_HEADERS} DESTINATION include)
+++ /dev/null
-INCLUDES = -I$(top_srcdir)/utils @BOOST_CPPFLAGS@ @LIBI2NCOMMON_CFLAGS@
-METASOURCES = AUTO
-lib_LTLIBRARIES = libasyncio.la
-libasyncio_la_SOURCES = async_callout.cpp async_io.cpp async_pipe.cpp \
- async_process.cpp async_socket.cpp async_timer.cpp
-include_HEADERS = async_callout.hpp async_io.hpp async_pipe.hpp \
- async_process.hpp async_socket.hpp async_timer.hpp \
- ../asyncio_config.hpp
-libasyncio_la_LIBADD = @LIBI2NCOMMON_LIBS@ @BOOST_LDFLAGS@ @BOOST_SIGNALS_LIB@
-
-libasyncio_la_LDFLAGS = -version-info @LIBASYNCIO_LIB_VERSION@
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA= libasyncio.pc
-
-$(top_srcdir)/headerlist.asyncio: $(include_HEADERS)
- list='$(include_HEADERS)'; \
- ( for n in $$list; do echo $(includedir)/$$( basename $$n ) ; done) > $@
-
-.PHONY: headerlist
-headerlist: $(top_srcdir)/headerlist.asyncio
--- /dev/null
+/* asyncio_config.hpp.in.cmake: configure input file for cmake */
+
+/* define if the Boost library is available */
+#cmakedefine HAVE_BOOST
+
+/* define if the Boost::Signals library is available */
+#cmakedefine HAVE_BOOST_SIGNALS
+
+/* define if the Boost::Unit_Test_Framework library is available */
+#cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine01 HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine01 HAVE_INTTYPES_H
+
+/* define if libi2ncommon is available */
+#cmakedefine HAVE_LIBI2NCOMMON
+
+/* define if libt2n is available */
+#cmakedefine HAVE_LIBT2N
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine01 HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine01 HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine01 HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine01 HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine01 HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine01 HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine01 HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine01 HAVE_UNISTD_H
+
+/* Name of package */
+#define PACKAGE "${PROJECT_NAME}"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "${PROJECT_NAME}"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "${PROJECT_NAME} ${VERSION}"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "${PROJECT_NAME}"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "${VERSION}"
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine01 STDC_HEADERS
+
+/* Version number of package */
+#define VERSION "${VERSION}"
+++ /dev/null
-AC_INIT(libasyncio, 0.2)
-AC_PREREQ([2.50])
-AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER(asyncio_config.hpp)
-
-AC_CONFIG_FILES(Makefile asyncio/Makefile asyncio/libasyncio.pc doc/Doxyfile
- utils/libasyncio_utils.pc
- doc/Makefile glue_t2n/Makefile glue_t2n/libasyncio_t2n.pc unittest/Makefile utils/Makefile
- libasyncio.spec
- )
-
-
-LIBASYNCIO_LIB_VERSION=0:0:0
-
-AC_SUBST(LIBASYNCIO_LIB_VERSION)
-
-AC_LANG_CPLUSPLUS
-AC_PROG_CXX
-AM_PROG_LIBTOOL
-
-
-AC_ARG_WITH(optimize,
-AS_HELP_STRING([--with-optimize],[compile with optimizing]),
-[
- AC_MSG_CHECKING(for optimizing)
- if test "$withval" != "no"; then
- CXXFLAGS=" -g -O2 "
- AC_MSG_RESULT(yes)
- else
- CXXFLAGS=" -g -O0 "
- AC_MSG_RESULT(no)
- fi
-],[ CXXFLAGS=" -g -O0 "])
-
-dnl check for doxygen
-AC_PATH_PROG(DOXYGEN, doxygen)
-AM_CONDITIONAL(HAVE_DOXYGEN, test -n $DOXYGEN)
-
-dnl check for libraries:
-
-PKG_CHECK_MODULES(LIBI2NCOMMON, libi2ncommon,
-[have_i2ncommon=yes
- AC_DEFINE([HAVE_LIBI2NCOMMON],,[define if libi2ncommon is available])
-],
-[have_i2ncommon=no
- AC_MSG_NOTICE([building without libi2ncommon support])
-])
-AM_CONDITIONAL([HAVE_LIBI2NCOMMON],[test x$have_i2ncommon = xyes])
-
-AX_BOOST_BASE([1.34])
-AX_BOOST_SIGNALS
-AX_BOOST_UNIT_TEST_FRAMEWORK
-if test "x$BOOST_SIGNALS_LIB" = "x"; then
- AC_MSG_ERROR([Sorry, we need the Signals-Lib from Boost.])
-fi
-if test "x$BOOST_UNIT_TEST_FRAMEWORK_LIB" = "x"; then
- AC_MSG_ERROR([Sorry, we need the unit test framework from Boost.])
-fi
-
-LIBT2N_CHECK(libt2n,[
- have_libt2n=yes
- AC_DEFINE([HAVE_LIBT2N],,[define if libt2n is available])
-],[
- have_libt2n=no
- AC_MSG_NOTICE([Building without libt2n support])
-])
-AM_CONDITIONAL([HAVE_LIBT2N],[test x$have_libt2n = xyes])
-
-
-dnl
-dnl spit out the result files:
-
-AC_OUTPUT
+++ /dev/null
-CLEANFILES = rm -rf html man
-
-if HAVE_DOXYGEN
-MANUALS = html/index.html
-else
-MANUALS =
-endif
-
-all: $(MANUALS)
-
-html/index.html: $(top_srcdir)/asyncio/*.cpp $(top_srcdir)/asyncio/*.hpp $(top_srcdir)/glue_t2n/*.hpp $(top_srcdir)/glue_t2n/*.cpp $(srcdir)/index.doc $(top_srcdir)/utils/*.hpp $(top_srcdir)/utils/*.cpp Doxyfile
- $(DOXYGEN)
-
-EXTRA_DIST = index.doc Doxyfile.in
--- /dev/null
+# Sources
+set(libasyncio_t2n_SOURCES asyncio_t2n.cpp)
+set(libasyncio_t2n_HEADERS asyncio_t2n.hpp)
+include_directories(BEFORE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/asyncio
+ ${CMAKE_SOURCE_DIR}/utils
+ )
+
+# Libraries
+add_library(libasyncio_t2n SHARED ${libasyncio_t2n_SOURCES} ${libasyncio_t2n_HEADERS})
+set_target_properties(libasyncio_t2n PROPERTIES VERSION ${VERSION} SOVERSION 0)
+set_target_properties(libasyncio_t2n PROPERTIES OUTPUT_NAME asyncio_t2n)
+set_target_properties(libasyncio_t2n PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+add_library(libasyncio_t2n-static STATIC ${libasyncio_t2n_SOURCES} ${libasyncio_t2n_HEADERS})
+set_target_properties(libasyncio_t2n-static PROPERTIES OUTPUT_NAME asyncio_t2n)
+set_target_properties(libasyncio_t2n-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+# Dependencies
+target_link_libraries(libasyncio_t2n libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES})
+target_link_libraries(libasyncio_t2n-static libasyncio ${LIBT2N_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES})
+
+# Installation
+install(TARGETS libasyncio_t2n LIBRARY DESTINATION lib)
+install(TARGETS libasyncio_t2n-static ARCHIVE DESTINATION lib)
+install(FILES ${libasyncio_t2n_HEADERS} DESTINATION include)
+++ /dev/null
-INCLUDES = -I$(top_srcdir)/asyncio -I$(top_srcdir)/utils @BOOST_CPPFLAGS@ \
- @LIBI2NCOMMON_CFLAGS@ @LIBT2N_CFLAGS@
-METASOURCES = AUTO
-lib_LTLIBRARIES = libasyncio_t2n.la
-libasyncio_t2n_la_LIBADD = $(top_builddir)/asyncio/libasyncio.la \
- @LIBT2N_LIBS@ @BOOST_LDFLAGS@ @BOOST_SIGNALS_LIB@ @LIBI2NCOMMON_LIBS@
-
-libasyncio_t2n_la_LDFLAGS = -version-info @LIBASYNCIO_LIB_VERSION@
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA= libasyncio_t2n.pc
-include_HEADERS = asyncio_t2n.hpp
-libasyncio_t2n_la_SOURCES = asyncio_t2n.cpp
+++ /dev/null
-<?xml version = '1.0'?>
-<kdevelop>
- <general>
- <author>Reinhard Pfau</author>
- <email>reinhard.pfau@intra2net.com</email>
- <version>0.1</version>
- <projectmanagement>KDevAutoProject</projectmanagement>
- <primarylanguage>C++</primarylanguage>
- <keywords>
- <keyword>C++</keyword>
- <keyword>Code</keyword>
- </keywords>
- <versioncontrol>kdevsubversion</versioncontrol>
- <ignoreparts/>
- <projectname>libasyncio</projectname>
- </general>
- <kdevautoproject>
- <general>
- <activetarget>asyncio/libasyncio.la</activetarget>
- </general>
- <run>
- <runarguments>
- <testconnd/>
- </runarguments>
- <debugarguments>
- <testconnd/>
- </debugarguments>
- <cwd>
- <testconnd>/home/reinhard/source/source/libasyncio/./</testconnd>
- </cwd>
- </run>
- <configurations>
- <optimized>
- <builddir>optimized</builddir>
- <ccompiler>kdevgccoptions</ccompiler>
- <cxxcompiler>kdevgppoptions</cxxcompiler>
- <f77compiler>kdevg77options</f77compiler>
- <cxxflags>-O2 -g0</cxxflags>
- </optimized>
- <debug>
- <configargs>--enable-debug=full</configargs>
- <builddir>debug</builddir>
- <ccompiler>kdevgccoptions</ccompiler>
- <cxxcompiler>kdevgppoptions</cxxcompiler>
- <f77compiler>kdevg77options</f77compiler>
- <cxxflags>-O0 -g3</cxxflags>
- </debug>
- </configurations>
- <make>
- <envvars>
- <envvar value="1" name="WANT_AUTOCONF_2_5" />
- <envvar value="1" name="WANT_AUTOMAKE_1_6" />
- </envvars>
- </make>
- </kdevautoproject>
- <kdevdoctreeview>
- <ignoretocs>
- <toc>ada</toc>
- <toc>ada_bugs_gcc</toc>
- <toc>bash</toc>
- <toc>bash_bugs</toc>
- <toc>clanlib</toc>
- <toc>w3c-dom-level2-html</toc>
- <toc>fortran_bugs_gcc</toc>
- <toc>gnome1</toc>
- <toc>gnustep</toc>
- <toc>gtk</toc>
- <toc>gtk_bugs</toc>
- <toc>haskell</toc>
- <toc>haskell_bugs_ghc</toc>
- <toc>java_bugs_gcc</toc>
- <toc>java_bugs_sun</toc>
- <toc>kde2book</toc>
- <toc>opengl</toc>
- <toc>pascal_bugs_fp</toc>
- <toc>php</toc>
- <toc>php_bugs</toc>
- <toc>perl</toc>
- <toc>perl_bugs</toc>
- <toc>python</toc>
- <toc>python_bugs</toc>
- <toc>qt-kdev3</toc>
- <toc>ruby</toc>
- <toc>ruby_bugs</toc>
- <toc>sdl</toc>
- <toc>w3c-svg</toc>
- <toc>sw</toc>
- <toc>w3c-uaag10</toc>
- <toc>wxwidgets_bugs</toc>
- </ignoretocs>
- <ignoreqt_xml>
- <toc>Guide to the Qt Translation Tools</toc>
- <toc>Qt Assistant Manual</toc>
- <toc>Qt Designer Manual</toc>
- <toc>Qt Reference Documentation</toc>
- <toc>qmake User Guide</toc>
- </ignoreqt_xml>
- <ignoredoxygen>
- <toc>KDE Libraries (Doxygen)</toc>
- </ignoredoxygen>
- </kdevdoctreeview>
- <kdevfilecreate>
- <useglobaltypes>
- <type ext="cpp" />
- <type ext="h" />
- </useglobaltypes>
- </kdevfilecreate>
- <kdevfileview>
- <groups>
- <group pattern="*.h" name="Header files" />
- <group pattern="*.cpp" name="Source files" />
- <hidenonprojectfiles>false</hidenonprojectfiles>
- <hidenonlocation>false</hidenonlocation>
- </groups>
- <tree>
- <hidepatterns>*.o,*.lo,CVS</hidepatterns>
- <hidenonprojectfiles>false</hidenonprojectfiles>
- <showvcsfields>false</showvcsfields>
- </tree>
- </kdevfileview>
- <kdevdocumentation>
- <projectdoc>
- <docsystem>Doxygen Documentation Collection</docsystem>
- <docurl>libasyncio.tag</docurl>
- </projectdoc>
- </kdevdocumentation>
- <substmap>
- <APPNAME>libasyncio</APPNAME>
- <APPNAMELC>libasyncio</APPNAMELC>
- <APPNAMESC>Libasyncio</APPNAMESC>
- <APPNAMEUC>LIBASYNCIO</APPNAMEUC>
- <AUTHOR>Reinhard Pfau</AUTHOR>
- <EMAIL>reinhard.pfau@intra2net.com</EMAIL>
- <LICENSE>Custom</LICENSE>
- <VERSION>0.1</VERSION>
- <YEAR>2008</YEAR>
- <dest>/home/reinhard/source/source/libasyncio</dest>
- </substmap>
- <kdevcppsupport>
- <qt>
- <used>false</used>
- <version>3</version>
- <includestyle>3</includestyle>
- <root>/usr/lib/qt-3.3</root>
- <designerintegration>EmbeddedKDevDesigner</designerintegration>
- <qmake>/usr/lib/qt-3.3/bin/qmake</qmake>
- <designer>/usr/lib/qt-3.3/bin/designer</designer>
- <designerpluginpaths/>
- </qt>
- <references/>
- <codecompletion>
- <automaticCodeCompletion>false</automaticCodeCompletion>
- <automaticArgumentsHint>true</automaticArgumentsHint>
- <automaticHeaderCompletion>true</automaticHeaderCompletion>
- <codeCompletionDelay>250</codeCompletionDelay>
- <argumentsHintDelay>400</argumentsHintDelay>
- <headerCompletionDelay>250</headerCompletionDelay>
- <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
- <completionBoxItemOrder>0</completionBoxItemOrder>
- <howEvaluationContextMenu>true</howEvaluationContextMenu>
- <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
- <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
- <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
- <processPrimaryTypes>true</processPrimaryTypes>
- <processFunctionArguments>false</processFunctionArguments>
- <preProcessAllHeaders>false</preProcessAllHeaders>
- <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
- <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
- <alwaysParseInBackground>true</alwaysParseInBackground>
- <usePermanentCaching>true</usePermanentCaching>
- <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
- <includePaths>.;</includePaths>
- </codecompletion>
- </kdevcppsupport>
-</kdevelop>
+++ /dev/null
-Summary: library with asynchronous io functionality
-Name: libasyncio
-Version: 0.2
-Release: 1
-License: GPL version 2 + linking exception
-Group: Intranator
-Vendor: Intra2net AG
-Source: %{name}-%{version}.tar.gz
-Buildroot: /tmp/%{name}-%{version}-root
-Prefix: /usr
-Requires: libi2ncommon >= 1.0
-Requires: boost >= 1.32.0
-BuildPrereq: libtool
-BuildRequires: boost-devel >= 1.32.0
-Obsoletes: libsimpleio
-
-%description
-library with asynchronous io functionality
-
-
-%package devel
-Summary: library with asynchronous io functionality
-Group: Intranator/Development
-Requires: libi2ncommon-devel
-Requires: boost-devel >= 1.32.0
-Obsoletes: libsimpleio-devel
-
-
-%description devel
-development files for library with asynchronous io functionality
-
-
-%package utils
-Summary: library with asynchronous io functionality
-Group: Intranator
-Requires: boost >= 1.32.0
-
-%description utils
-A collection of util function and classes used within asyncio, but
-are also usable for other purposes, too.
-
-
-%package utils-devel
-Summary: library with asynchronous io functionality
-Group: Intranator/Development
-Requires: boost-devel >= 1.32.0
-
-%description utils-devel
-development files for asyncio utils.
-
-
-%package t2n
-Summary: glue library for using t2n with libasyncio
-Group: Intranator
-BuildRequires: libt2n-devel >= 0.4
-Requires: libt2n >= 0.4
-Obsoletes: libsimpleio-t2n
-
-%description t2n
-glue lib for using t2n with simpleio.
-
-
-%package t2n-devel
-Summary: glue library for using t2n with libasyncio
-Group: Intranator/Development
-Requires: libt2n-devel >= 0.4
-
-%description t2n-devel
-development files for glue lib for using t2n with simpleio.
-
-
-
-%prep
-%setup -q
-
-%build
-export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
-autoreconf --force -i
-./configure $RPM_BUILD_WITH_OPTIMIZE --prefix=%{prefix}
-make
-
-for dir in utils asyncio; do
- make -C $dir headerlist
-done
-
-make check
-
-%install
-make DESTDIR=$RPM_BUILD_ROOT install
-
-# Remove unpackaged files
-rm -f $RPM_BUILD_ROOT/usr/lib/libasyncio_utils.a
-rm -f $RPM_BUILD_ROOT/usr/lib/libasyncio_utils.la
-
-%clean
-rm -fr $RPM_BUILD_ROOT
-
-%post
-/sbin/ldconfig
-
-%files
-%defattr(-,root,root)
-%doc LICENSE COPYING.GPL
-%{prefix}/lib/libasyncio.so*
-
-%files devel -f headerlist.asyncio
-%defattr(-,root,root)
-%{prefix}/lib/libasyncio.*a*
-%{prefix}/lib/pkgconfig/libasyncio.pc
-
-
-%files utils
-%defattr(-,root,root)
-%{prefix}/lib/libasyncio_utils.so*
-
-
-%files utils-devel -f headerlist.utils
-%defattr(-,root,root)
-%{prefix}/lib/libasyncio.*a*
-%{prefix}/lib/pkgconfig/libasyncio_utils.pc
-
-
-%files t2n
-%defattr(-,root,root)
-%doc LICENSE
-%{prefix}/lib/libasyncio_t2n.so*
-
-%files t2n-devel
-%defattr(-,root,root)
-%{prefix}/lib/libasyncio_t2n.*a*
-%{prefix}/lib/pkgconfig/libasyncio_t2n.pc
-%{prefix}/include/asyncio_t2n*.hpp
-
-@HAVE_LIBI2NCOMMON_TRUE@%define with_libi2ncommon 1
-@HAVE_LIBI2NCOMMON_FALSE@%define with_libi2ncommon 0
-@HAVE_LIBT2N_TRUE@%define with_t2n 1
-@HAVE_LIBT2N_FALSE@%define with_t2n 1
+# @HAVE_LIBI2NCOMMON_TRUE@%define with_libi2ncommon 1
+# @HAVE_LIBI2NCOMMON_FALSE@%define with_libi2ncommon 0
+# @HAVE_LIBT2N_TRUE@%define with_libt2n 1
+# @HAVE_LIBT2N_FALSE@%define with_libt2n 0
+%define with_libi2ncommon 1
+%define with_libt2n 1
Summary: library with asynchronous io functionality
Name: libasyncio
Group: Intranator
Vendor: Intra2net AG
Source: %{name}-%{version}.tar.gz
-Buildroot: /tmp/%{name}-%{version}-root
+# Buildroot: /tmp/%{name}-%{version}-root
Prefix: /usr
Requires: libi2ncommon >= 1.0
-Requires: libasynio-utils = %{version}
-BuildRequires: libtool
+Requires: boost >= 1.32.0
+Requires: libasyncio-utils = %{version}
+# BuildRequires: libtool
BuildRequires: boost-devel >= 1.32.0
Obsoletes: libsimpleio
%package utils
Summary: library with asynchronous io functionality
Group: Intranator
-%if %{with_libi2ncommon}
+%if %{with libi2ncommon}
Requires: libi2ncommon >= 1.0
%endif
+Requires: boost >= 1.32.0
%description utils
A collection of util function and classes used within asyncio, but
development files for asyncio utils.
-%if %{with_libt2n}
+%if %{with libt2n}
%package t2n
Summary: glue library for using t2n with libasyncio
Group: Intranator
%build
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
-autoreconf --force -i
-./configure $RPM_BUILD_WITH_OPTIMIZE --prefix=%{prefix}
-make %{?_smp_mflags}
+# autoreconf --force -i
+# ./configure $RPM_BUILD_WITH_OPTIMIZE --prefix=%{prefix}
-for dir in utils asyncio; do
- make -C $dir headerlist
-done
+mkdir build
+cd build
+
+export CFLAGS="$RPM_OPT_FLAGS"
+export CXXFLAGS="$RPM_OPT_FLAGS"
+
+CMAKE_OPTS=""
+%if %{with libi2ncommon}
+ CMAKE_OPTS="$CMAKE_OPTS -DWITH_LIBI2NCOMMON=ON"
+%endif
+%if %{with libt2n}
+ CMAKE_OPTS="$CMAKE_OPTS -DWITH_LIBT2N=ON"
+%endif
+
+cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
+
+dmake %{?_smp_mflags}
export BOOST_TEST_LOG_LEVEL=test_suite
-make check
+dmake check
%install
+cd build
make DESTDIR=$RPM_BUILD_ROOT install
# Remove unpackaged files
%doc LICENSE COPYING.GPL
%{prefix}/lib/libasyncio.so*
-%files devel -f headerlist.asyncio
+%files devel -f build/headerlist.asyncio
%defattr(-,root,root)
%{prefix}/lib/libasyncio.*a*
%{prefix}/lib/pkgconfig/libasyncio.pc
%{prefix}/lib/libasyncio_utils.so*
-%files utils-devel -f headerlist.utils
+%files utils-devel -f build/headerlist.utils
%defattr(-,root,root)
%{prefix}/lib/libasyncio.*a*
%{prefix}/lib/pkgconfig/libasyncio_utils.pc
-
-%if %{with_libt2n}
+%if %{with libt2n}
%files t2n
%defattr(-,root,root)
%doc LICENSE
+++ /dev/null
-# ===========================================================================
-# http://autoconf-archive.cryp.to/ax_boost_base.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_BASE([MINIMUM-VERSION])
-#
-# DESCRIPTION
-#
-# Test for the Boost C++ libraries of a particular version (or newer)
-#
-# If no path to the installed boost library is given the macro searchs
-# under /usr, /usr/local, /opt and /opt/local and evaluates the
-# $BOOST_ROOT environment variable. Further documentation is available at
-# <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
-#
-# And sets:
-#
-# HAVE_BOOST
-#
-# LAST MODIFICATION
-#
-# 2008-04-12
-#
-# COPYLEFT
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-AC_DEFUN([AX_BOOST_BASE],
-[
-AC_ARG_WITH([boost],
- AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ac_boost_path=""
- else
- want_boost="yes"
- ac_boost_path="$withval"
- fi
- ],
- [want_boost="yes"])
-
-
-AC_ARG_WITH([boost-libdir],
- AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
- [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
- [
- if test -d $withval
- then
- ac_boost_lib_path="$withval"
- else
- AC_MSG_ERROR(--with-boost-libdir expected directory name)
- fi
- ],
- [ac_boost_lib_path=""]
-)
-
-if test "x$want_boost" = "xyes"; then
- boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
- boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
- boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
- boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
- boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
- if test "x$boost_lib_version_req_sub_minor" = "x" ; then
- boost_lib_version_req_sub_minor="0"
- fi
- WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
- AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
- succeeded=no
-
- dnl first we check the system location for boost libraries
- dnl this location ist chosen if boost libraries are installed with the --layout=system option
- dnl or if you install boost with RPM
- if test "$ac_boost_path" != ""; then
- BOOST_LDFLAGS="-L$ac_boost_path/lib"
- BOOST_CPPFLAGS="-I$ac_boost_path/include"
- else
- for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
- if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
- BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
- BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
- break;
- fi
- done
- fi
-
- dnl overwrite ld flags if we have required special directory with
- dnl --with-boost-libdir parameter
- if test "$ac_boost_lib_path" != ""; then
- BOOST_LDFLAGS="-L$ac_boost_lib_path"
- fi
-
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_LANG_PUSH(C++)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- @%:@include <boost/version.hpp>
- ]], [[
- #if BOOST_VERSION >= $WANT_BOOST_VERSION
- // Everything is okay
- #else
- # error Boost version is too old
- #endif
- ]])],[
- AC_MSG_RESULT(yes)
- succeeded=yes
- found_system=yes
- ],[
- ])
- AC_LANG_POP([C++])
-
-
-
- dnl if we found no boost with system layout we search for boost libraries
- dnl built and installed without the --layout=system option or for a staged(not installed) version
- if test "x$succeeded" != "xyes"; then
- _version=0
- if test "$ac_boost_path" != ""; then
- if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
- for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
- _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
- V_CHECK=`expr $_version_tmp \> $_version`
- if test "$V_CHECK" = "1" ; then
- _version=$_version_tmp
- fi
- VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
- BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
- done
- fi
- else
- for ac_boost_path in /usr /usr/local /opt /opt/local ; do
- if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
- for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
- _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
- V_CHECK=`expr $_version_tmp \> $_version`
- if test "$V_CHECK" = "1" ; then
- _version=$_version_tmp
- best_path=$ac_boost_path
- fi
- done
- fi
- done
-
- VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
- BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
- if test "$ac_boost_lib_path" = ""
- then
- BOOST_LDFLAGS="-L$best_path/lib"
- fi
-
- if test "x$BOOST_ROOT" != "x"; then
- if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
- version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
- stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
- stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
- V_CHECK=`expr $stage_version_shorten \>\= $_version`
- if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
- AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
- BOOST_CPPFLAGS="-I$BOOST_ROOT"
- BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
- fi
- fi
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_LANG_PUSH(C++)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- @%:@include <boost/version.hpp>
- ]], [[
- #if BOOST_VERSION >= $WANT_BOOST_VERSION
- // Everything is okay
- #else
- # error Boost version is too old
- #endif
- ]])],[
- AC_MSG_RESULT(yes)
- succeeded=yes
- found_system=yes
- ],[
- ])
- AC_LANG_POP([C++])
- fi
-
- if test "$succeeded" != "yes" ; then
- if test "$_version" = "0" ; then
- AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
- else
- AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
- fi
- else
- AC_SUBST(BOOST_CPPFLAGS)
- AC_SUBST(BOOST_LDFLAGS)
- AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
-fi
-
-])
+++ /dev/null
-# ===========================================================================
-# http://autoconf-archive.cryp.to/ax_boost_signals.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_SIGNALS
-#
-# DESCRIPTION
-#
-# Test for Signals library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_SIGNALS_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_SIGNALS
-#
-# LAST MODIFICATION
-#
-# 2008-04-12
-#
-# COPYLEFT
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2008 Michael Tindal
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-AC_DEFUN([AX_BOOST_SIGNALS],
-[
- AC_ARG_WITH([boost-signals],
- AS_HELP_STRING([--with-boost-signals@<:@=special-lib@:>@],
- [use the Signals library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-signals=boost_signals-gcc-mt-d ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_signals_lib=""
- else
- want_boost="yes"
- ax_boost_user_signals_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_CACHE_CHECK(whether the Boost::Signals library is available,
- ax_cv_boost_signals,
- [AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/signal.hpp>
- ]],
- [[boost::signal<void ()> sig;
- return 0;
- ]]),
- ax_cv_boost_signals=yes, ax_cv_boost_signals=no)
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_signals" = "xyes"; then
- AC_DEFINE(HAVE_BOOST_SIGNALS,,[define if the Boost::Signals library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
- if test "x$ax_boost_user_signals_lib" = "x"; then
- for libextension in `ls $BOOSTLIBDIR/libboost_signals*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_signals.*\)\.so.*$;\1;' -e 's;^lib\(boost_signals.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
- [link_signals="no"])
- done
- if test "x$link_signals" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_signals*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_signals.*\)\.dll.*$;\1;' -e 's;^\(boost_signals.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
- [link_signals="no"])
- done
- fi
-
- else
- for ax_lib in $ax_boost_user_signals_lib boost_signals-$ax_boost_user_signals_lib; do
- AC_CHECK_LIB($ax_lib, main,
- [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
- [link_signals="no"])
- done
-
- fi
- if test "x$link_signals" != "xyes"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
+++ /dev/null
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_boost_unit_test_framework.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_UNIT_TEST_FRAMEWORK
-#
-# DESCRIPTION
-#
-# Test for Unit_Test_Framework library from the Boost C++ libraries. The
-# macro requires a preceding call to AX_BOOST_BASE. Further documentation
-# is available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_UNIT_TEST_FRAMEWORK
-#
-# LICENSE
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
-[
- AC_ARG_WITH([boost-unit-test-framework],
- AS_HELP_STRING([--with-boost-unit-test-framework@<:@=special-lib@:>@],
- [use the Unit_Test_Framework library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_unit_test_framework_lib=""
- else
- want_boost="yes"
- ax_boost_user_unit_test_framework_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_CACHE_CHECK(whether the Boost::Unit_Test_Framework library is available,
- ax_cv_boost_unit_test_framework,
- [AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/test/unit_test.hpp>]],
- [[using boost::unit_test::test_suite;
- test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0;]]),
- ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no)
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
- AC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_Test_Framework library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
-
- if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then
- saved_ldflags="${LDFLAGS}"
- for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.{so,a}* 2>/dev/null` ; do
- if test -r $monitor_library ; then
- libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'`
- ax_lib=${libextension}
- link_unit_test_framework="yes"
- else
- link_unit_test_framework="no"
- fi
-
- if test "x$link_unit_test_framework" = "xyes"; then
- BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"
- AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
- break
- fi
- done
- if test "x$link_unit_test_framework" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;' -e 's;^\(boost_unit_test_framework.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break],
- [link_unit_test_framework="no"])
- done
- fi
- else
- link_unit_test_framework="no"
- saved_ldflags="${LDFLAGS}"
- for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do
- if test "x$link_unit_test_framework" = "xyes"; then
- break;
- fi
- for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.{so,a}* 2>/dev/null` ; do
- if test -r $unittest_library ; then
- libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'`
- ax_lib=${libextension}
- link_unit_test_framework="yes"
- else
- link_unit_test_framework="no"
- fi
-
- if test "x$link_unit_test_framework" = "xyes"; then
- BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"
- AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)
- break
- fi
- done
- done
- fi
- if test "x$link_unit_test_framework" != "xyes"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
+++ /dev/null
-dnl test for libt2n and libt2n-codegen
-dnl LIBT2N(VERSION, action-if, action-not)
-AC_DEFUN([LIBT2N_CHECK],
-[
- PKG_CHECK_MODULES(LIBT2N, [$1], [
- LIBT2N_CODEGEN=`$PKG_CONFIG --variable libt2n_codegen libt2n`
- LIBT2N_DATADIR=`$PKG_CONFIG --variable libt2n_datadir libt2n`
- LIBT2N_CLIENT_PCTEMPLATE="$LIBT2N_DATADIR/clientlib.pc.in"
- $2
- ], [$3])
- AC_SUBST(LIBT2N_CODEGEN)
- AC_SUBST(LIBT2N_DATADIR)
- AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE)
-
- dnl newer automake versions do not allow to use += on undefined variables
- dnl but we want to use += in codegen.make (s.a. examples-codegen/example1)
- dnl as workaround we always define them
- dnl see also:
- dnl automake ml: subject: "automake conditional append"
- dnl http://sourceware.org/ml/automake/2005-01/msg00019.html
- dnl
- dnl Note:
- dnl if you update from libt2n 0.1 to 0.2
- dnl you must take care to pick up the right libt2n.m4
-
- AC_SUBST([include_HEADERS], [''])
- AC_SUBST([BUILT_SOURCES], [''])
- AC_SUBST([CLEANFILES], [''])
- AC_SUBST([DISTCLEANFILES], [''])
- AC_SUBST([EXTRA_DIST], [''])
-])
--- /dev/null
+# Sources
+set(testsimpleio_SOURCES test_simpleio_basics.cpp)
+include_directories(BEFORE
+ ${CMAKE_SOURCE_DIR}/asyncio
+ ${CMAKE_SOURCE_DIR}/utils
+)
+
+# Executables
+add_executable(testsimpleio ${testsimpleio_SOURCES})
+
+# Dependencies
+target_link_libraries(testsimpleio libasyncio_utils libasyncio ${Boost_LIBRARIES} ${LIBI2NCOMMON_LIBRARIES})
+
+# Tests
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS testsimpleio)
+enable_testing()
+add_test(testsimpleio testsimpleio)
+++ /dev/null
-INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/asyncio -I$(top_srcdir)/utils \
- @BOOST_CPPFLAGS@ @LIBI2NCOMMON_CFLAGS@
-METASOURCES = AUTO
-check_PROGRAMS = testsimpleio
-testsimpleio_SOURCES = test_simpleio_basics.cpp
-testsimpleio_LDADD = $(top_builddir)/utils/libasyncio_utils.la \
- $(top_builddir)/asyncio/libasyncio.la @BOOST_LDFLAGS@ @BOOST_SIGNALS_LIB@ @BOOST_UNIT_TEST_FRAMEWORK_LIB@ @LIBI2NCOMMON_LIBS@
-
-TESTS = testsimpleio
--- /dev/null
+# Sources
+add_subdirectory(i2ncommon)
+set(libasyncio_utils_SOURCES
+ asyncio_time_tools.cpp
+ asyncio_utils.cpp
+ asyncio_system_tools.cpp
+ ${compat_SOURCES}
+)
+set(libasyncio_utils_HEADERS
+ asyncio_ptr_list.hpp
+ asyncio_utils.hpp
+ asyncio_time_tools.hpp
+ asyncio_pointer_func.hpp
+ asyncio_system_tools.hpp
+ asyncio_containerfunc.hpp
+ asyncio_signalfunc.hpp
+ ${compat_HEADERS}
+)
+include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/i2ncommon)
+
+# Libraries
+add_library(libasyncio_utils SHARED ${libasyncio_utils_SOURCES} ${libasyncio_utils_HEADERS})
+set_target_properties(libasyncio_utils PROPERTIES VERSION ${VERSION} SOVERSION 0)
+set_target_properties(libasyncio_utils PROPERTIES OUTPUT_NAME asyncio_utils)
+
+# Headerlist
+foreach(header_file_in ${libasyncio_utils_HEADERS})
+ set(header_files_out "${header_files_out}${includedir}/${header_file_in}\n")
+endforeach()
+file(WRITE ${CMAKE_BINARY_DIR}/headerlist.utils ${header_files_out})
+
+# Installation
+install(TARGETS libasyncio_utils LIBRARY DESTINATION lib)
+install(FILES ${libasyncio_utils_HEADERS} DESTINATION include)
+++ /dev/null
-AUTOMAKEOPTIONS = foreign 1.4
-
-INCLUDES = @BOOST_CPPFLAGS@
-METASOURCES = AUTO
-
-lib_LTLIBRARIES = libasyncio_utils.la
-
-if HAVE_LIBI2NCOMMON
-compat_headers=
-compat_sources=
-else
-compat_headers= i2ncommon/containerfunc.hpp i2ncommon/signalfunc.hpp
-compat_sources= i2ncommon/containerfunc.cpp i2ncommon/signalfunc.cpp
-endif
-
-include_HEADERS = asyncio_ptr_list.hpp asyncio_utils.hpp asyncio_time_tools.hpp \
- asyncio_pointer_func.hpp asyncio_system_tools.hpp \
- asyncio_containerfunc.hpp asyncio_signalfunc.hpp \
- $(compat_headers)
-libasyncio_utils_la_SOURCES = asyncio_time_tools.cpp asyncio_utils.cpp \
- asyncio_system_tools.cpp \
- $(compat_sources)
-
-libasyncio_utils_la_LDFLAGS = -version-info @LIBASYNCIO_LIB_VERSION@
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA= libasyncio_utils.pc
-
-
-$(top_srcdir)/headerlist.utils: $(include_HEADERS)
- list='$(include_HEADERS)'; \
- ( for n in $$list; do echo $(includedir)/$$n ; done) > $@
-
-.PHONY: headerlist
-headerlist: $(top_srcdir)/headerlist.utils
--- /dev/null
+# Sources
+if(WITH_LIBI2NCOMMON)
+ set(compat_HEADERS
+ containerfunc.hpp
+ signalfunc.hpp
+ )
+ set(compat_SOURCES
+ containerfunc.cpp
+ signalfunc.cpp
+ )
+endif(WITH_LIBI2NCOMMON)