# 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})
-/* asyncio_config.hpp.in: configure input file for cmake */
+/* asyncio_config.hpp.in.cmake: configure input file for cmake */
/* define if the Boost library is available */
-#cmakedefine HAVE_BOOST ${Boost_FOUND}
+#cmakedefine HAVE_BOOST
/* define if the Boost::Signals library is available */
-#cmakedefine HAVE_BOOST_SIGNALS ${Boost_SIGNALS_FOUND}
+#cmakedefine HAVE_BOOST_SIGNALS
/* define if the Boost::Unit_Test_Framework library is available */
-#cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK ${Boost_UNIT_TEST_FRAMEWORK_FOUND}
+#cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine01 HAVE_DLFCN_H
#cmakedefine01 HAVE_INTTYPES_H
/* define if libi2ncommon is available */
-#cmakedefine HAVE_LIBI2NCOMMON ${LIBI2NCOMMON_FOUND}
+#cmakedefine HAVE_LIBI2NCOMMON
/* define if libt2n is available */
-#cmakedefine HAVE_LIBT2N ${LIBT2N_FOUND}
+#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 <unistd.h> header file. */
#cmakedefine01 HAVE_UNISTD_H
-/* Define to the sub-directory in which libtool stores uninstalled libraries. */
-#cmakedefine LT_OBJDIR "${LT_OBJDIR}"
-
/* Name of package */
-#cmakedefine PACKAGE "${PROJECT_NAME}"
+#define PACKAGE "${PROJECT_NAME}"
/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT ""
+#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME "${PROJECT_NAME}"
+#define PACKAGE_NAME "${PROJECT_NAME}"
/* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING "${PROJECT_NAME} ${VERSION}"
+#define PACKAGE_STRING "${PROJECT_NAME} ${VERSION}"
/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME "${PROJECT_NAME}"
+#define PACKAGE_TARNAME "${PROJECT_NAME}"
/* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION "${VERSION}"
+#define PACKAGE_VERSION "${VERSION}"
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine01 STDC_HEADERS
/* Version number of package */
-#cmakedefine VERSION "${VERSION}"
+#define VERSION "${VERSION}"